I have been using the following to open a doc file in VFP 8:
oWord = CREATEOBJECT("Word.Application")
oDocument = oWord.Documents.OPEN(MYLOCATION+'\'+C_FILE_NUM+'.DOC')
WITH oWord
.Application.WindowState = 1
.Application.Visible = .T.
ENDWITH

This work OK in XP even when I have another instance of Word open. It
creates another instance of word, opens the file up and displays it.

BUT When I use the same commands in VISTA and there is an instance of Word
on the taskbar it opens that instance file up as well as the new one and the
bad part is it puts the old file on top of the new file I am trying to open.
Is there any reason why in VISTA the CreateObject does not open up a new
instance of Word?? At least is there a way that I can get the new file I am
opening on top on the old file that was on the task bar??
Thanks for any help.
TonySper

Re: Word Automation VISTA Problem by Krister

Krister
Sun Dec 30 08:07:50 CST 2007

I tried it in Vista + Word 2003 and it behaves like you descibe for XP.
Maybe you have different Word-versions in your XP / Vista installs?

"TonySper" <tsperduti@nospambellsouth.net> skrev i meddelandet
news:uURAW6nSIHA.3400@TK2MSFTNGP03.phx.gbl...
>I have been using the following to open a doc file in VFP 8:
> oWord = CREATEOBJECT("Word.Application")
> oDocument = oWord.Documents.OPEN(MYLOCATION+'\'+C_FILE_NUM+'.DOC')
> WITH oWord
> .Application.WindowState = 1
> .Application.Visible = .T.
> ENDWITH
>
> This work OK in XP even when I have another instance of Word open. It
> creates another instance of word, opens the file up and displays it.
>
> BUT When I use the same commands in VISTA and there is an instance of Word
> on the taskbar it opens that instance file up as well as the new one and
> the bad part is it puts the old file on top of the new file I am trying to
> open. Is there any reason why in VISTA the CreateObject does not open up a
> new instance of Word?? At least is there a way that I can get the new file
> I am opening on top on the old file that was on the task bar??
> Thanks for any help.
> TonySper
>
>


Re: Word Automation VISTA Problem by TonySper

TonySper
Sun Dec 30 12:11:26 CST 2007

Thank you for trying. I am using Microsoft Office 2003. I am trying it on a
Dell Laptop with Vista Business. It may be the laptop. I just can not get it
to open a different instance of Word for some reason.
Thanks for the feedback.
TonySper

"Krister" <anyone@nowhere.com> wrote in message
news:WCNdj.2206$R_4.1164@newsb.telia.net...
>I tried it in Vista + Word 2003 and it behaves like you descibe for XP.
>Maybe you have different Word-versions in your XP / Vista installs?
>
> "TonySper" <tsperduti@nospambellsouth.net> skrev i meddelandet
> news:uURAW6nSIHA.3400@TK2MSFTNGP03.phx.gbl...
>>I have been using the following to open a doc file in VFP 8:
>> oWord = CREATEOBJECT("Word.Application")
>> oDocument = oWord.Documents.OPEN(MYLOCATION+'\'+C_FILE_NUM+'.DOC')
>> WITH oWord
>> .Application.WindowState = 1
>> .Application.Visible = .T.
>> ENDWITH
>>
>> This work OK in XP even when I have another instance of Word open. It
>> creates another instance of word, opens the file up and displays it.
>>
>> BUT When I use the same commands in VISTA and there is an instance of
>> Word on the taskbar it opens that instance file up as well as the new one
>> and the bad part is it puts the old file on top of the new file I am
>> trying to open. Is there any reason why in VISTA the CreateObject does
>> not open up a new instance of Word?? At least is there a way that I can
>> get the new file I am opening on top on the old file that was on the task
>> bar??
>> Thanks for any help.
>> TonySper
>>
>>
>