Re: Word mutti-session handling within VBA
- From: "Ed" <ed_millis@xxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Mar 2006 06:55:40 -0700
I have my VBA code fires up a word doc at run time, which does some search
and text gathering and populates into an Access table, then it QUIT (by
oWord.QUIT method).
At this stage if the user opens another word doc
Not quite sure I get this. This sounds like AFTER your macro has run to the
end and quit, and THEN the user opens up another Word doc, you get problems?
Or the other scenario is that the user opens another Word doc WHILE the
macro is still running. If you are using the code I gave you as it is with
no modifications, then your problem is right there! That code uses the
Selection object (because Range does not have the wdLine method, whilst
Selection does). It also does not set a document object to work on; in
other words, the code assumes the only document open will be the one you
want searched. If you open another document, you change your focus - AND
what the Selection object sees.
In VBA, how to manage multi-sessions of MS Words (let's say some fire up
by
VBA,
some fire up by user interactively)?
That depends on whether the code is opening the document, the code presents
the user with a dialog box to choose a document to open, or the user is
opening a document unrelated to the process.
Ed
"QK" <QK@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B9363CE4-84D0-4D40-B046-D31FD9C6B4E0@xxxxxxxxxxxxxxxx
I have my VBA code fires up a word doc at run time, which does some search
and text gathering and populates into an Access table, then it QUIT (by
oWord.QUIT method).
At this stage if the user opens another word doc, play around and exit,
the
"automated" word doc is prompted for "save/cancel" (I'm sure at this satge
the "text gathering and populates into an Access table" hasn't completed
yet).
It ends up the populated info into the Access table is totally unexpected!
In VBA, how to manage multi-sessions of MS Words (let's say some fire up
by
VBA,
some fire up by user interactively)?
Thanks
.
- Follow-Ups:
- Prev by Date: Re: Opening specific folder clicking user defined button
- Next by Date: Re: How to find the bottom of a table in VBA
- Previous by thread: Re: Word mutti-session handling within VBA
- Next by thread: Re: Word mutti-session handling within VBA
- Index(es):