Thursday, July 17, 2014

Power tools for open xml TextReplacer is not working with myDoc.MainDocumentPart.Document.Body

Solution 1:
use seperate WordprocessingDocument and put code into that
 using (WordprocessingDocument myDoc = WordprocessingDocument.Open(memoryStream, true, new OpenSettings()))
        {
        }

Solution 2:
use XDocument xDoc = myDoc.MainDocumentPart.GetXDocument(); which will give XML of wordprocessing document

No comments:

Post a Comment