Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to just create application wich contain button and rich text box
while user clicks on button a new dialogue box will open and user will choose word or pdf files and selected files content will be displayed in our rich textbox or any other suitable tool

There is a namespace Microsoft.office but I got an error for office on namespace
so any one can help me to import documents in our application?
Posted

1 solution

You did not explain where to import, so I'll leave it to you.

To read Word .docx document, you can use Microsoft Open XML SDK. Please see my past answers referenced in this one: How to add microsoft excel 15.0 object library from Add Reference in MS Visual Studio 2010[^].

To work with PDF, you can use, for example, https://pdfapi.codeplex.com[^] or http://itextpdf.com[^] or iTextSharp: http://sourceforge.net/projects/itextsharp[^].

—SA
 
Share this answer
 
v2
Comments
Member 11713217 10-Aug-15 2:47am    
I want to import it into my windows form application(in rich text box)
Sergey Alexandrovich Kryukov 10-Aug-15 2:51am    
You did not say "rich text box". I answered your original question, so please accept it formally.
But what's the problem? RTF is an open format. Not clear how it is related to your Forms application.
—SA
Member 11713217 10-Aug-15 3:05am    
sorry but if you read my explanation I have explain in first line that there is one button and one rich text box
Sergey Alexandrovich Kryukov 10-Aug-15 3:32am    
You are right, it's there. Then the answer may depend on what RichTextBox type you are using. Will you tell us the exact full type name? I can think about it, but it looks to me that you have to use raw RTF markup and use the RTF standard to parse it. This CodeProject article can give you the idea: http://www.codeproject.com/Articles/11306/NRTFTree-A-class-library-for-RTF-processing-in-C.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900