Re: macros using 2 open documents.



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.
> >
> >


.



Relevant Pages

  • [PATCH] x86_64: mm fix x86 cpuid keys used in alternative_smp fix
    ... The x86_64 crosstool build was failing due to: ... This reference to X86_FEATURE_UP was added to the definition of ... the alternative_smpmacro in alternative.h by the patch: ... The alternative_smpmacro is used in spinlock.h. ...
    (Linux-Kernel)
  • Re: Im desperate!! Search, if found, insert, else search for nex
    ... reference document wherever they exists and puts the corresponding text from ... Word MVP web site http://word.mvps.org ... If I understand the macro you sent, I can change the reference to the ... Dim ChangeDoc As Document ...
    (microsoft.public.word.vba.general)
  • Re: Im desperate!! Search, if found, insert, else search for nex
    ... The original macro looks for the codes from the first column of the ... reference document wherever they exists and puts the corresponding text from ... Word MVP web site http://word.mvps.org ... The data source table, however, ...
    (microsoft.public.word.vba.general)
  • Re: Im desperate!! Search, if found, insert, else search for nex
    ... My reference document (only used for finding the text to replace the codes ... in the data source) is the one that has two columns. ... Word MVP web site http://word.mvps.org ... If I understand the macro you sent, I can change the reference to the ...
    (microsoft.public.word.vba.general)
  • Re: How to make custom linked cross-references?
    ... If somebody wants the package on CTAN, ... a macro \p@which is intended for providing some ... A reference to section~of this book ... You might wish to take reference to yet another label within ...
    (comp.text.tex)