Setting Focus to Word

G

Guest

Hello,

I am using the following code, but would like to set the focus to MS Word
after completion. Any help is appreciated:

Dim oApp As Object
Set oApp = CreateObject("Word.Application")

oApp.Documents.Open "f:\filename.doc"

Note: both oApp.Visible = True and oApp.Application.Visible=True does not do
the trick.

Any help is appreciated.
 
A

a

Hi,

Try the AppActivate statement.
This statement activates any application visible in the taskbar.
Supply the text you see on the taskbar button.
It depends on your Word version if you need to supply only the title of your
document (Word 2000 and higher) or "Microsoft Word" (Word 97).
See the online help for more detailed information.
 
G

Guest

Hello,
I am using the following code, but would like to set the focus to MS Word
after completion. Any help is appreciated:

Dim oApp As Object
Set oApp = CreateObject("Word.Application")

oApp.Documents.Open "f:\filename.doc"

Note: both oApp.Visible = True and oApp.Application.Visible=True does not do
the trick.

Any help is appreciated.

Hi David, if all you want to do is open a file/document for the user,
consider:

Application.FollowHyperlink "f:\filename.doc",,true

You are then not required to even know that this file is a word document...

Luck
Jonathan
 

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