Re: macros using 2 open documents.
- From: "Miskacee" <kate39@xxxxxxxxxx>
- Date: Tue, 6 Dec 2005 07:12:02 -0800
by saying 'other doc' how would that point to the employee name.doc document?
In other words, how can I reference the document whose name will change,
i.e. employee name.doc. It will always be another employee name that will be
used to extract this data from the document and put into the 'table' in the
static document, table.doc.
Thanks for any assistance you can provide in order to get this error free.
"Tony Jollans" wrote:
> 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.
> > >
> > >
>
>
>
.
- References:
- Re: macros using 2 open documents.
- From: Tony Jollans
- Re: macros using 2 open documents.
- Prev by Date: Re: macros using 2 open documents.
- Next by Date: Re: Replace text strings with different format with VBA
- Previous by thread: Re: macros using 2 open documents.
- Next by thread: Re: macros using 2 open documents.
- Index(es):
Relevant Pages
|