views:

177

answers:

1

Hi,

I can use the MS Word ActiveX control in order to access some parameters related to the MS Word application itself. I can also open up new documents and then perform automation on those documents.

Is it also possible to access documents that were already open on my machine and then perform actions on them?

The code I'm using is the following (in a javascript block of a web page):

var w=new ActiveXObject('Word.Application');
w.Visible = true;
var doc = w.Documents.Add();
A: 

It turned out that I just needed to initialize the ActiveX component in a different way:

var w = GetObject('',"Word.Application");

This way I could enumerate and access all documents open in the user's machine.

jhrecife