Reading and Editing a Microsoft Word Document Using C #

I am new to C # and I need a little help. I have to load Microsoft text files into richTextBox, change the text and save this text in some Microsoft Word formats. I would appreciate it if you could point me to the libraries and examples that I should use to achieve this.

+3
source share
2 answers

If you are using a newer version of MS Office, you should study the OpenXML SDK . Older versions of Word will require Interop directly to Word.

The advantage of the OpneXML SDK is that your application will not use Office directly. You do not need to install Office on every machine the application runs on. The drawback (depending on how you watch it) is that you can only save the new OpenXML format (.docx).

+2
source

Look at the namespace Microsoft.Office.Interop.Word. It should have most of what you need. http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word(v=office.11).aspx

+3
source

Source: https://habr.com/ru/post/1793400/


All Articles