This project has moved and is read-only. For the latest updates, please go here.

How to grab the activeDocument of a running instance

Mar 30, 2012 at 11:28 AM
Edited Mar 30, 2012 at 11: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 5:32 PM
Edited Mar 30, 2012 at 5: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