Closing a Microsoft Word document

Mischa mischa at omnislab.com
Tue Mar 3 12:54:51 EST 2015


Hi Dawid,

why do you open the template, anyway? The usual way would be to tell Word to create a new document using template xy.dot - or do I miss something?

Best greetings
Mischs

---------------------------------------------------
  T H E   O M N I S   L /\ B     www.omnislab.com
---------------------------------------------------


-----Ursprüngliche Nachricht-----
Von: omnisdev-en-bounces at lists.omnis-dev.com [mailto:omnisdev-en-bounces at lists.omnis-dev.com] Im Auftrag von Dawid Mocke
Gesendet: Dienstag, 03. März 2015 18:41
An: OmnisDev List - English
Betreff: Closing a Microsoft Word document

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
working.
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.
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list