Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

How to get updated word contents from the Word Document using Open XML Sdk.

$
0
0

Hi Everyone,

I have created a Word Application in VSTO (C#). I have a Active word document where i have created lots of modifications like i have created some bookmarks, highlighted some text. Now after that i am creating wordprocessingdocument object by using fileStream of the same active document. Here is the code:

Stream stream = new FileStream(wdDocument.Path + "//" + wdDocument.Name, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
WordprocessingDocument wpd = WordprocessingDocument.Open(stream, false);

Now here the problem is, because the document is not saved i am not getting the updated contents from the WordProcessingDocument object. Is there any way to get the updated contents from the document without saving?

or is there any other way to load the active document to stream and read the contents from there?

Thanks,


Shahab Abbasi


Viewing all articles
Browse latest Browse all 1288

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>