Okay, first, honors to The Great Ted for this...it's like the last piece
of a puzzle that makes everything complete.
And just to make sure I understand why this helps, my guess is that
GETOBJECT() creates a pointer to the existing, activated OLE app, and
therefore it prevents the OLE app from responding in the same way as it
would by direct interaction. Please correct me if that's wrong (probably
not 100% on target, but...)
Would it be good practice, to prevent consuming more and more memory, to
release the GETOBJECT() reference after the document is printed (and
before you iterate for the next document)?
Thanks again Jack, Ted, for providing enlightenment!
Mike Copeland
-------- Original Message --------
Subject: Re: Print A Word Document From VFP
From: Jack Skelley <[email protected]>
To: [email protected]
Date: 5/10/2013 8:20 AM
Good Morning Ted:
The getobject(,word.application) runs much better with no screen flash! Thank
you!
I knew what I was doing was kluge at best but at the time this is the only way
I could think to make it work. And when folks are waiting to print the 725 docs
it needed to get done.
There was a deadline on this and, of course, it was on a rush job order which
went to top of the other rush job items.
This is why I love the quote from Douglas Adams "I love deadlines. I love the
whooshing noise they make as they go by". Douglas Adams was the former Doctor Who
script writer and creator of The Hitchhikers Guide To The Galaxy.
I have this line in all my projects.
I appreciate your help!
Best regards
Jack
Jack:
It's only been thirteen years since I edited "Microsoft Office Automation
with Visual FoxPro" http://www.hentzenwerke.com/catalog/autofox.htm and,
well, you can always count on things from Microsoft changing.
If you are processing a set of documents in a row, you shouldn't need to
recreate the Word application object each time. I think this is a case
where you want to use GETOBJECT on the 2nd and later documents, rather than
CREATEOBJECT once you've started Word, and then Close() the document
(after, as you've noted, a pause for it to queue, or perhaps just close
them all at the end) and Open() a new document and work on that, rather
than have the Automation system start a new version of Word each time.
Now, whether Word behaves well under these circumstances is something
you'll need to test...
Jack Skelley
Senior Director, Programming/Computer Operations
New Jersey Devils
(973)757-6164
[email protected]
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.