How to use AppActivate

  • Thread starter Thread starter Albert D. Kallal
  • Start date Start date
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.
 
Ah, found a soltion:

Just changed:
AppActivate "Microsoft Word"

to
WordApp.Activate

All is fine......
 
Back
Top