I need to extract formatted text snippets of a Word document and store it inside an SQL Server table, for later processing and then reinsertion in the Word document using C#.
I’ve had a look at the Word DOM and it seems that I need to use a combination of the Document.Load(), Document.Save() and Range.Copy(), Range.Paste() methods to create a file for each snippets that I then load into the DB.
Isn’t there a easier (more efficient way)?
By the way the code snippets can be hidden text and I was thinking about storing the snippets as RTF.
Finally I got to use Aspose.Words for .NET to extract the code snippets from the Word file I’m interested in and store them as RTF:
One can then store the rtf into a text field of the database as usual and edit it in a RTF text control.