Ideas for refreshing whole contents of Word with VSTO document-level addin

sadap 1 Reputation point
2020-12-24T07:50:46.177+00:00

Hi all,

Do you have any ideas/scenarios to refresh whole contents in Word document which is attached VSTO document-level addin?
The best scenario for me is "Re-open" the another document with keeping the attachment of VSTO addin to extract not only the document-body contents but also header, footer and page-setup related contents. I've tried "InsertXML" method, succeeded in cloning the body but failed in cloning the contents outside...

        private static void SimpleClone(Document docFrom, Document docTo, string saveAsDocTo)
        {
            (docTo.Range() as Range).InsertXML((docFrom.Range() as Range).WordOpenXML);
            docTo.SaveAs2(FileName: saveAsDocTo);
        }
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,963 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.