Using C# & OpenXML, I need to create a document. The document have series of paragraphs created under docs body. I need to make few paragraphs ready-only. To accomplish this the entire document made read-only. Edit permission to few paragraphs are provided using permStart and permEnd tags. The generated document sent to the user.
The user could edit the editable paras, could add lot of information using tables, paragraphs & could format the text using different color, font size, font type. After making these changes user sends the document back to the server, where I need to extract each editable area's text with complete format and structure & store into a database table. Each editable area's text goes to one column of the table. After saving all editable area's text into their corresponding columns, the docx file discarded.
In future when user requests the same document, we need to take the stored content from db and create a document, by recreating the content with all original formatting/structure.
My question is how can we extract the paragraph with all its formatting intact and store into a database table & recreate the content in another document in future request for the same document.
I'm using OpenXML SDK 2.0, MS-Visual Studio 2010, .NET 4.0 and Win7 OS. The user will use Office 2007/2010 to edit the content.
Any suggestion and C# code snippet to extract the paragraph content with formatting would be very helpful.
I am also in kind of a similar situation. In my case I have html stored in DB and I have to display that html (Converting it to the text by applying all the styles from html etc.) in my Word Document (2007). I can see no one has replied to your post yet. Did you get any solution or help from anywhere else so far?
Your help will really be appreciated.
I have suggested a solution in this thread. Please have a look.