Hello all,
If there is a way to work with MS Office Objects without displaying them, I would greatly appreciate learning how to do it. My problem is that I have not yet found a way to set the "Visible" property of these COM objects (I assume, without actually knowing, that they are in fact COM objects) to "False", which will make processing less obtrusive and use less resources (i.e. no display resources required). Below is some AutoHotkey code which does what I want to do: open a document and save it under another name (of course I would normally process the document before saving it, but for purposes of illustration this may suffice).
wd := ComObjCreate("Word.Application")
; Create a COM Word object for manipulation
wd.Visible := False
; Set its "Visible" property to "False".
doc := wd.Documents.Open(A_ScriptDir . "\Document2.docx")
; Open a document for processing
sleep, 100
; A delay inserted for quick prototyping.
; There are better ways to accomplish this.
wd.ActiveDocument.SaveAs(A_ScriptDir . "\DocumentX.docx")
; Now that we have the active document (which is "doc" in our case),
; save it under another name.
doc.Close()
wd.Quit()
; Close and quit, of course, releasing the object and resources.
Any help with this will be deeply appreciated!
Regards,
Winter