How to use AppActivate

A

Albert D. Kallal

I have some word automation code (it is from ms-access).

For a good many years, for word 97 I have used:

WordApp.Visible = True
WordApp.Windows(WordApp.Windows.Count).Activate

AppActivate "Microsoft Word"
WordApp.WindowState = 0 'wdWindowStateRestore

The problem with the above code is now each window in word is a separate
task bar, and I get a runtime error on:

AppActivate "Microsoft Word"

Of course, the correct format is now "docname - Microsoft Word"

Or, something like:

AppActivate "MyDocName - " & "Microsoft Word"

Any possibility of coming up with some code that will work for both word 97,
and word 2002 (xp) ?

I kind of don't want to maintain two versions of the code. Any ideas welcome
here.
 
A

Albert D. Kallal

Ah, found a soltion:

Just changed:
AppActivate "Microsoft Word"

to
WordApp.Activate

All is fine......
 

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