Re: macros using 2 open documents.
- From: "Tony Jollans" <My Forename at My Surname dot com>
- Date: Mon, 5 Dec 2005 20:12:47 -0000
Hi Miskacee,
We seem to be failing to communicate. What your documents are is not
relevant to the technical solution you are asking for.
You previously used Windows(1) and Windows(2) to reference two documents.
That relies on documents (or windows)being opened in a particular order and
is now failing you. You can reference open documents either via the window
or via the document but you must know something about what you're looking
for.
You say one of the documents always has a fixed name so you know what that
is and can hard code a reference to it ..
Set FixedDoc = Documents("FixedDocName")
The question is: how are you going to be able to recognise the other
document and the questions I asked were designed to help me find out how you
might be able to do that.
If you only ever have two documents open you should be able to do something
like this ...
For Each OtherDoc in Documents
If not OtherDoc is FixedDoc Then Exit For
Next
You will then have two document references, FixedDoc and OtherDoc which you
can use.
If your situation is somehow different then a different solution will be
applicable. If so, please come back with details.
--
Enjoy,
Tony
"Miskacee" <kate39@xxxxxxxxxx> wrote in message
news:171FB56D-157E-4FBA-BA37-C55DE009EC09@xxxxxxxxxxxxxxxx
> One document is a table layout where the actual information from the
employee
> word document is stored. The table layout is the 'static' table and the
> other document will always be an employee name. The information from the
> employee name document is 'loaded' into the variable table - (Word
document
> with table layout - which will always be used to 'house' the information
from
> the employee document) via macros/bookmarks and cross-references.
>
> "Miskacee" wrote:
>
> > I have a macro that goes back and forth between two documents. One
document
> > will also be the same name while the other document will always have a
> > different name. In the past, I was able to create: Windows(2).Activate
or
> > Windows(1).Activate and the macro worked fine flipping back and forth.
> > However, now active window (1) has become active window (2) and vice
versa
> > for some reason and therefore, the macro won't function properly. I am
able
> > to call the one document that remains static in name but would like to
locate
> > code that would call the other active window, no matter what the name.
I
> > know I use $ in the code but don't remember how to focus on the document
that
> > would have a different name.
> >
> > The net net, I'm copying information from one document and placing it in
> > another document which is a 'table' via bookmarks and cross-references.
> >
> > Thank you for any help you can provide.
> >
> >
.
- Follow-Ups:
- Re: macros using 2 open documents.
- From: Miskacee
- Re: macros using 2 open documents.
- Prev by Date: Re: Select a Combobox - display results in 2 others
- Next by Date: How do I use Do...Loop
- Previous by thread: Re: macros using 2 open documents.
- Next by thread: Re: macros using 2 open documents.
- Index(es):
Relevant Pages
|