MS Word ActiveX Control - Can I Open Open Documents?

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

Can I also access documents that have already been opened on my computer and then perform actions on them?

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

var w=new ActiveXObject('Word.Application'); w.Visible = true; var doc = w.Documents.Add(); 
+4
source share
1 answer

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

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

Thus, I can list and open all documents opened on the user machine.

+2
source

Source: https://habr.com/ru/post/1302108/


All Articles