Re: Word in background in Vista

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



TommyD <TommyD@xxxxxxxxxxxxxxxxxxxxxxxxx>'s wild thoughts
were released on Thu, 12 Apr 2007 06:38:03 -0700 bearing the
following fruit:

Tried Activate, didn't help.
/Tommy

OK, I just tried your code and word appears at the back.

I added an Active and word appears at the front.

Dim objWord As Object

Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Activate

J



"Jan Hyde (VB MVP)" wrote:

TommyD <TommyD@xxxxxxxxxxxxxxxxxxxxxxxxx>'s wild thoughts
were released on Thu, 12 Apr 2007 03:56:02 -0700 bearing the
following fruit:

Hi,

I have a vb6 app which opens Word and inserts some text into the Word
document.

When using Win2k/WinXp Word opens in front but when using Vista Word opens
in the background of my app, why?

This is the code I use:
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True

IIRC they made a change with XP to prevent applications from
stealing the focus (which could be annoying) they seem to
have taken this further with Vista. However it doesn't make
a distinction beween other apps and apps lauched by you app
the *should* steal focus.

Try calling the Activate method of Word (or is it the
document itself?) anyway IIRC that should bring it to the
front.

J


Thanks

Tommy



.



Relevant Pages

  • Re: Word in background in Vista
    ... I use Vista Business and Word 2007. ... Set objWord = CreateObject ... I have a vb6 app which opens Word and inserts some text into the Word ... When using Win2k/WinXp Word opens in front but when using Vista Word opens ...
    (microsoft.public.vb.general.discussion)
  • Re: Word in background in Vista
    ... following fruit: ... I use Vista Business and Word 2007. ... I have a vb6 app which opens Word and inserts some text into the Word ... When using Win2k/WinXp Word opens in front but when using Vista Word opens ...
    (microsoft.public.vb.general.discussion)
  • Re: ActiveX create problem in Vista
    ... following fruit: ... Application with "elevated privileges" is NOT a solution unless the app ... Can't drag from a lower privilege and drop on ...
    (microsoft.public.vb.general.discussion)
  • Re: Performance tuning
    ... bearing the following fruit: ... >Are there any tools that will show me what is the factor limiting performance for my app? ...
    (microsoft.public.vb.enterprise)
  • Re: Cant edit module.
    ... following fruit: ... >> I have many Forms in my app, and own some of them (the ... A grenade thrown into a kitchen in France would result in ... Linoleum Blownapart. ...
    (microsoft.public.vb.general.discussion)