Word Automation Focus?

E

eric

Hi!

I'm using word automation from HTML to open Word and various documents. The
first time (when I open the application) Word and the document shows. The
second time (when Word is already open) it dosn't always show Word, instead
the minimized icon just flickers shortly in the task bar. I'd like the
document to show/get focus every time.

Any ideas?

Thx!

/e
 
C

Cindy M.

Hi Eric,
I'm using word automation from HTML to open Word and various documents. The
first time (when I open the application) Word and the document shows. The
second time (when Word is already open) it dosn't always show Word, instead
the minimized icon just flickers shortly in the task bar. I'd like the
document to show/get focus every time.
If you don't show us the code, it's difficult to make suggestions...

But have you tried the .Activate method of the application and/or document
object?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
E

eric

Hi!

Feel like I've tried anything.

The code (hta-file):

Set oApp = GetObject(,"Word.Application")
If Err.Number <> 0 Then
Set oApp = CreateObject("Word.Application")
End If
oApp.Visible = True

oApp.documents.add "letter.dot"

This works great the first time. But once Word is running (or xl or
whatever) the second (or third etc) document just flicker shortly on the
icon/button in the taskbar. It's no huuuge problem, but it would be nice if
Word could show and get focus with the new document.

Any suggestions?

Best
/e
 
C

Cindy M.

Hi Eric,
Set oApp = GetObject(,"Word.Application")
If Err.Number <> 0 Then
Set oApp = CreateObject("Word.Application")
End If
oApp.Visible = True

oApp.documents.add "letter.dot"

This works great the first time. But once Word is running (or xl or
whatever) the second (or third etc) document just flicker shortly on the
icon/button in the taskbar. It's no huuuge problem, but it would be nice if
Word could show and get focus with the new document.
Yes, but you're NOT using the Activate method that I can see. Try that.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
H

Hansueli Rickli

Ich habe das Problem auch mit activate, aber nur bei einigen Kunden
Was anders ist bei diesen habe ich noch nicht rausgefunden.
Hansueli Rickli
 

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