Closing a Microsoft Word document

Dawid Mocke dawidmocke at
Tue Mar 3 12:40:55 EST 2015

Hi Guys,
I have successfully integrated to MS Word some years ago, but have never
been able to actually close a document.  So I open a template, save it as
something else and then merge the new document.
I have tried a couple of times to close the template, but never got it
Now I have a situation where I have to generate a lot of documents in quick
succesession and while the original template is open, Microsoft will ask
you everytime if you want to open a 'Read-Only' copy, or replace, etc.

As you can understand this is both time consuming and very irritating.

This is the code I use to open the template:
Do iWordDocObjCollection.$open(iWordTempPath,kFalse,kFalse,kTrue) Returns
iWordDocObj     ;; open template file

To save the document as something else:
Do iWordDocObj.$SaveAs(iWordDocPath) Returns #F

Then I try and close the original template and I have tried the following
with no success:
Do iWordDocObj.$::close(iWordTempPath) Returns #F
Do iWordDocObj.$close(iWordTempPath) Returns #F

Any ideas that I can try?

thank you,

Dawid Mocke
This message (and any associated files) is intended only for the use of the
individual or entity to which it is addressed and may contain information
that is confidential, subject to copyright or constitutes a trade secret.
If you are not the intended recipient you are hereby notified that any
dissemination, copying or distribution of this message, or files associated
with this message, is strictly prohibited. If you have received this
message in error, please notify us immediately by replying to the message
and deleting it from your computer.

More information about the omnisdev-en mailing list