This project has moved. For the latest updates, please go here.

How to grab the activeDocument of a running instance

Mar 30, 2012 at 10:28 AM
Edited Mar 30, 2012 at 10:32 AM


How can I grab the current running instance of Word to get an reference for the actice document.

I do not want to create a new application in netoffice, beacuse the user has Word already running. Is there a way to attach the running instance to netoffice, to grad the activedocument from there?

The word was not created through netoffice!



Mar 30, 2012 at 4:32 PM
Edited Mar 30, 2012 at 4:34 PM


this is an example code snippet:

// Initialize NetOffice

object wordProxy = System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application");
Word.Application wordApplication = new Word.Application(null, wordProxy);

// do all the things here


an advanced exemplary workflow is available in the examples. Misc\GetRunningOutlookInstance