Re: macros using 2 open documents.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



Relevant Pages

  • Re: Employee hrs worked
    ... just have a Categories table and reference this from ... Projects are an entirely different entity type so use a separate Projects ... ProjectName (SubCategory) ... work on many projects and each project will involve more than one employee ...
    (microsoft.public.access.gettingstarted)
  • Re: When A Have a Collections of Bs -- a Design Question
    ... > StockItem stockItem = new StockItem ... if two objects each hold a reference ... > where i usually let a department own a list of employee just like the ... This base class only exposes read only properties (getters ...
    (comp.object)
  • Re: macros using 2 open documents.
    ... > am able to do so now again, reference Windowsactivateor and place ... I am calling the 'table' document, ... >> Windows.Activate and the macro worked fine flipping back and forth. ... >> The net net, I'm copying information from one document and placing it in ...
    (microsoft.public.word.vba.general)
  • RE: Getting (internal) senders account ID (userID)
    ... I've got some basic code that scrapes email sender, subject, and some ... The reference table I have that includes employee ID ...
    (microsoft.public.outlook.program_vba)
  • Re: Delete Query
    ... then when you delete the row from the Employee table all ... it will tell you this when you try to implement the Cascade Deletes. ... The diagram gives you a visual reference to see ... with parent on the left and child on the right. ...
    (microsoft.public.access.queries)