Multiple Open Documents

J

JBNewsGroup

Hi,

I have an open document that contains a table. In the userform I open a
"master" document and use the info from that to update the table.
Somewhere, either in a NG, FAQ or link, I saw a response or article on how
to handle working with multiple documents in VBA. Can anyone point me to
the document or response. I cannot seem to find it as I forgot to bookmark
the item.

Thanks in advance for a response.

Jerry Bodoff
 
J

JBNewsGroup

Hi Jezebel,

Thanks.

I wasn't sure about accessing each document. I assume I can use the pDoc for
each target (pDocMaster, pDocTable) without worrying about the document
indexes changing.

When I access a document this way do I have to make the document I am
working with Active? In other words to access the master
pDocMaster.Activate and to update the table pDocTable.Activate. Or do I just
use pDocMaster.oParagraph and pDocTable.oTable without Activating?

Jerry Bodoff
 
J

Jean-Guy Marcil

JBNewsGroup was telling us:
JBNewsGroup nous racontait que :
Hi Jonathan,

Thanks a lot. That clarified things for me and actually makes the
code easier.

And do not forget not to use the Selection object, or you will have
surprises!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

JBNewsGroup

Hi Jean-Guy,

Can you elaborate a little bit. I was planning on using Range objects.

Jerry Bodoff
 
J

Jean-Guy Marcil

JBNewsGroup was telling us:
JBNewsGroup nous racontait que :
Hi Jean-Guy,

Can you elaborate a little bit. I was planning on using Range
objects.

Perfect!

The selection objects always refer to the currently Selected range, which
might not be the one you want when you have many documents opened. It is
sometimes difficult to control.
As you are planning to use the Range object, then everything is fine... I
just thought I would mention it in case...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top