View Single Post
 
Old 07-24-2018, 02:34 PM
ArtKilp ArtKilp is offline Windows 8 Office 2016
Novice
 
Join Date: Jan 2016
Posts: 18
ArtKilp is on a distinguished road
Default Inserting a QuickPart from Normal.dotm using C# interop?

I made a QuickPart to Normal.dotm and now I want to place it to the document
(where the cursor is) using C# interop. The basics (create application, create document, locate cursor etc.) doesn't need to be covered, I know those, but how does the beef of that work like?

Here's the same as "pseudocode"
Word.Document ActiveDoc = Globals.ThisAddIn.Application.ActiveDocument;
Word.Selection selected = Globals.ThisAddIn.Application.Selection;
Word.Range rng = selected.Range;
rng.AddQuickPart("Normal.dotm", "ThePartIJustCreated"); //This one obviously doesn't work
Reply With Quote