I have another problem with an application that runs OK in XP, 98, and 95
but not Vista.
I open a Word.doc file from a command button in a form as below in XP, 98,
or 95 and the Word doc file opens and displays on the screen so the user can
enter a letter in Word. When I use the same file in Vista it pops up on the
task bar and the user has to click on the task bar to open the file up.

oWORD = GetObject(MYLOCATION+'\'+'C_FILE_NUM+'.DOC')
WITH oWORD
.APPLICATION.WindowState = 1
.APPLICATION.VISIBLE = .T.
ENDWITH

No problem staring up Word with the document but it always ends up on the
task bar when run in Vista. Is there something to add so it will open up
without the user having to click the taskbar??
Tony

Re: Open Word file in Vista by TonySper

TonySper
Mon Sep 24 15:35:28 PDT 2007

I tried a simple program like this:
oWORD = CREATEOBJECT("WORD.APPLICATION")
WITH oWORD
.VISIBLE = .T.
.DOCUMENTS.ADD
ENDWITH

When I run this in XP the word doc file opens up and I can start printing
into it. BUT when I run this same program in Vista the word application is
put on the bottom task bar. I am using VFP8 and Office 2003 in both
applications. Is it possible that I need Office 2007 to use in Vista??
Tony

"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:uyh4NYt$HHA.4752@TK2MSFTNGP04.phx.gbl...
>I have another problem with an application that runs OK in XP, 98, and 95
>but not Vista.
> I open a Word.doc file from a command button in a form as below in XP, 98,
> or 95 and the Word doc file opens and displays on the screen so the user
> can enter a letter in Word. When I use the same file in Vista it pops up
> on the task bar and the user has to click on the task bar to open the file
> up.
>
> oWORD = GetObject(MYLOCATION+'\'+'C_FILE_NUM+'.DOC')
> WITH oWORD
> .APPLICATION.WindowState = 1
> .APPLICATION.VISIBLE = .T.
> ENDWITH
>
> No problem staring up Word with the document but it always ends up on the
> task bar when run in Vista. Is there something to add so it will open up
> without the user having to click the taskbar??
> Tony
>
>



Re: Open Word file in Vista by Dan

Dan
Mon Sep 24 16:02:29 PDT 2007

I suspect if anyone had the answer you would have heard the first time you
posted this. :-(

Can't say I'm surprised. They made so many security-based changes,
particularly in inter-application interaction, I'd be surprised if there
*weren't* new behaviors.

In WordBasic, we'd sometimes need to call AppActivate(). I'm not sure where
that landed in the object model.

You might want to ask in a Word newsgroup since I know a number of the Word
MVPs are using Vista, and this is more of a Word issue than a VFP issue.

Dan

TonySper wrote:
> I tried a simple program like this:
> oWORD = CREATEOBJECT("WORD.APPLICATION")
> WITH oWORD
> .VISIBLE = .T.
> .DOCUMENTS.ADD
> ENDWITH
>
> When I run this in XP the word doc file opens up and I can start
> printing into it. BUT when I run this same program in Vista the word
> application is put on the bottom task bar. I am using VFP8 and
> Office 2003 in both applications. Is it possible that I need Office
> 2007 to use in Vista?? Tony
>
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:uyh4NYt$HHA.4752@TK2MSFTNGP04.phx.gbl...
>> I have another problem with an application that runs OK in XP, 98,
>> and 95 but not Vista.
>> I open a Word.doc file from a command button in a form as below in
>> XP, 98, or 95 and the Word doc file opens and displays on the screen
>> so the user can enter a letter in Word. When I use the same file in
>> Vista it pops up on the task bar and the user has to click on the
>> task bar to open the file up.
>>
>> oWORD = GetObject(MYLOCATION+'\'+'C_FILE_NUM+'.DOC')
>> WITH oWORD
>> .APPLICATION.WindowState = 1
>> .APPLICATION.VISIBLE = .T.
>> ENDWITH
>>
>> No problem staring up Word with the document but it always ends up
>> on the task bar when run in Vista. Is there something to add so it
>> will open up without the user having to click the taskbar??
>> Tony



Re: Open Word file in Vista by TonySper

TonySper
Mon Sep 24 16:22:19 PDT 2007

Yes Dan, you are correct. I did post it twice. I was hoping that maybe
someone in the know maybe did not see it. BUT GOOD NEWS. I was playing
around some more with this problem and forgot about OLE and used
ShellExecute. Would you believe it worked. I was just coming back to the
users group to let you all know that ShellExecute does open the Word Doc
file and displays it on the screen. I would be lost if I could not use you
all on this users groups for sounding boards. Just communicating with you
helps me. My problem is I have waited until I have lost most of my hair
before I found you.
Tony

"Dan Freeman" <spam@microsoft.com> wrote in message
news:utwnA8v$HHA.5488@TK2MSFTNGP05.phx.gbl...
>I suspect if anyone had the answer you would have heard the first time you
>posted this. :-(
>
> Can't say I'm surprised. They made so many security-based changes,
> particularly in inter-application interaction, I'd be surprised if there
> *weren't* new behaviors.
>
> In WordBasic, we'd sometimes need to call AppActivate(). I'm not sure
> where that landed in the object model.
>
> You might want to ask in a Word newsgroup since I know a number of the
> Word MVPs are using Vista, and this is more of a Word issue than a VFP
> issue.
>
> Dan
>
> TonySper wrote:
>> I tried a simple program like this:
>> oWORD = CREATEOBJECT("WORD.APPLICATION")
>> WITH oWORD
>> .VISIBLE = .T.
>> .DOCUMENTS.ADD
>> ENDWITH
>>
>> When I run this in XP the word doc file opens up and I can start
>> printing into it. BUT when I run this same program in Vista the word
>> application is put on the bottom task bar. I am using VFP8 and
>> Office 2003 in both applications. Is it possible that I need Office
>> 2007 to use in Vista?? Tony
>>
>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>> news:uyh4NYt$HHA.4752@TK2MSFTNGP04.phx.gbl...
>>> I have another problem with an application that runs OK in XP, 98,
>>> and 95 but not Vista.
>>> I open a Word.doc file from a command button in a form as below in
>>> XP, 98, or 95 and the Word doc file opens and displays on the screen
>>> so the user can enter a letter in Word. When I use the same file in
>>> Vista it pops up on the task bar and the user has to click on the
>>> task bar to open the file up.
>>>
>>> oWORD = GetObject(MYLOCATION+'\'+'C_FILE_NUM+'.DOC')
>>> WITH oWORD
>>> .APPLICATION.WindowState = 1
>>> .APPLICATION.VISIBLE = .T.
>>> ENDWITH
>>>
>>> No problem staring up Word with the document but it always ends up
>>> on the task bar when run in Vista. Is there something to add so it
>>> will open up without the user having to click the taskbar??
>>> Tony
>
>



Re: Open Word file in Vista by TonySper

TonySper
Mon Sep 24 16:47:09 PDT 2007

Dan,
I celebrated to early. When using the CreateObject I was able to paste what
I put on the clip board to the doc file after I opened it. I just used
oWord.SELECTION.PASTE. Do you know how I would do this after I open the doc
file with shellexecute as there is no such action in it??
Any ideas??
Tony

"Dan Freeman" <spam@microsoft.com> wrote in message
news:utwnA8v$HHA.5488@TK2MSFTNGP05.phx.gbl...
>I suspect if anyone had the answer you would have heard the first time you
>posted this. :-(
>
> Can't say I'm surprised. They made so many security-based changes,
> particularly in inter-application interaction, I'd be surprised if there
> *weren't* new behaviors.
>
> In WordBasic, we'd sometimes need to call AppActivate(). I'm not sure
> where that landed in the object model.
>
> You might want to ask in a Word newsgroup since I know a number of the
> Word MVPs are using Vista, and this is more of a Word issue than a VFP
> issue.
>
> Dan
>
> TonySper wrote:
>> I tried a simple program like this:
>> oWORD = CREATEOBJECT("WORD.APPLICATION")
>> WITH oWORD
>> .VISIBLE = .T.
>> .DOCUMENTS.ADD
>> ENDWITH
>>
>> When I run this in XP the word doc file opens up and I can start
>> printing into it. BUT when I run this same program in Vista the word
>> application is put on the bottom task bar. I am using VFP8 and
>> Office 2003 in both applications. Is it possible that I need Office
>> 2007 to use in Vista?? Tony
>>
>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>> news:uyh4NYt$HHA.4752@TK2MSFTNGP04.phx.gbl...
>>> I have another problem with an application that runs OK in XP, 98,
>>> and 95 but not Vista.
>>> I open a Word.doc file from a command button in a form as below in
>>> XP, 98, or 95 and the Word doc file opens and displays on the screen
>>> so the user can enter a letter in Word. When I use the same file in
>>> Vista it pops up on the task bar and the user has to click on the
>>> task bar to open the file up.
>>>
>>> oWORD = GetObject(MYLOCATION+'\'+'C_FILE_NUM+'.DOC')
>>> WITH oWORD
>>> .APPLICATION.WindowState = 1
>>> .APPLICATION.VISIBLE = .T.
>>> ENDWITH
>>>
>>> No problem staring up Word with the document but it always ends up
>>> on the task bar when run in Vista. Is there something to add so it
>>> will open up without the user having to click the taskbar??
>>> Tony
>
>



Re: Open Word file in Vista by Roger

Roger
Mon Sep 24 20:04:44 PDT 2007


"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:e2RP4Uw$HHA.3940@TK2MSFTNGP05.phx.gbl...
> Dan,
> I celebrated to early. When using the CreateObject I was able to paste what I put on the clip
> board to the doc file after I opened it. I just used oWord.SELECTION.PASTE. Do you know how I
> would do this after I open the doc file with shellexecute as there is no such action in it??

Once you've launched Word with ShellExecute, you don't have any
control over it via VFP. To do that, you must use automation.
As Dan alluded to, you should use Word's Activate method to
bring Word to the foreground.

-Roger




Re: Open Word file in Vista by TonySper

TonySper
Mon Sep 24 20:07:44 PDT 2007

Roger,
Can you give me an example as to how to use Word's Activate method to bring
it to the foreground??? Not to familiar on the automation. I have read the
book on Microsoft Office Automation but nothing there on Activate method.
Tony

"Roger Ansell" <notmy@realemailaddress.net> wrote in message
news:Om2ab$x$HHA.5428@TK2MSFTNGP02.phx.gbl...
>
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:e2RP4Uw$HHA.3940@TK2MSFTNGP05.phx.gbl...
>> Dan,
>> I celebrated to early. When using the CreateObject I was able to paste
>> what I put on the clip board to the doc file after I opened it. I just
>> used oWord.SELECTION.PASTE. Do you know how I would do this after I open
>> the doc file with shellexecute as there is no such action in it??
>
> Once you've launched Word with ShellExecute, you don't have any
> control over it via VFP. To do that, you must use automation.
> As Dan alluded to, you should use Word's Activate method to
> bring Word to the foreground.
>
> -Roger
>
>
>



Re: Open Word file in Vista by Roger

Roger
Tue Sep 25 05:05:02 PDT 2007


"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:%23i209Ey$HHA.1212@TK2MSFTNGP05.phx.gbl...
> Roger,
> Can you give me an example as to how to use Word's Activate method to bring it to the
> foreground??? Not to familiar on the automation. I have read the book on Microsoft Office
> Automation but nothing there on Activate method.

oWord = CreateObject("Word.Application")
With oWord
.Visible = .T.
.Activate
EndWith

-Roger



Re: Open Word file in Vista by TonySper

TonySper
Tue Sep 25 08:01:11 PDT 2007

Roger,
Thanks for the help. Have tried as you suggested and the application still
remains on the taskbar when run in Vista. Will have to keep digging.
Tony

"Roger Ansell" <notmy@realemailaddress.net> wrote in message
news:OK9Ldt2$HHA.4836@TK2MSFTNGP06.phx.gbl...
>
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:%23i209Ey$HHA.1212@TK2MSFTNGP05.phx.gbl...
>> Roger,
>> Can you give me an example as to how to use Word's Activate method to
>> bring it to the foreground??? Not to familiar on the automation. I have
>> read the book on Microsoft Office Automation but nothing there on
>> Activate method.
>
> oWord = CreateObject("Word.Application")
> With oWord
> .Visible = .T.
> .Activate
> EndWith
>
> -Roger
>



Re: Open Word file in Vista by Roger

Roger
Tue Sep 25 08:25:01 PDT 2007


"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
> Roger,
> Thanks for the help. Have tried as you suggested and the application still remains on the taskbar
> when run in Vista. Will have to keep digging.
> Tony

OK, try experimenting with ...

oWord.WindowState = 1 && and ...
oWord.Activate

Don't have Vista but even in XP there are circumstances
where you need both.

-Roger



Re: Open Word file in Vista by Dan

Dan
Tue Sep 25 08:41:14 PDT 2007

Roger Ansell wrote:
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
>> Roger,
>> Thanks for the help. Have tried as you suggested and the application
>> still remains on the taskbar when run in Vista. Will have to keep
>> digging. Tony
>
> OK, try experimenting with ...
>
> oWord.WindowState = 1 && and ...
> oWord.Activate
>
> Don't have Vista but even in XP there are circumstances
> where you need both.

And even other circumstances where you have to resort to
FindWindow()/ShowWindow() API calls.

Tony, do you get the same results from an Excel macro? That would help tell
us whether this is peculiar to VFP automation or a Vista-in-general thing.

I'm starting to get curious enough I may install Vista in a virtual machine
shortly. I was hoping to put it off a little longer. <g>

Dan



Re: Open Word file in Vista by TonySper

TonySper
Tue Sep 25 09:12:46 PDT 2007

Roger,
Been trying it all. Do you know that oWord.Windowstate = 1 creates an error
but oWord.Application.Windowstate = 1 is OK.
Also oWord.Visible = .T. creates an error but oWord.Application.Visible =
.T. is OK. This is crazy trying to make an application that has been
running for 9 years on DOS all the way to XP but not on Vista.
If they are going to change the Automation you would think there would be
some articles or data around about it.
Tony

"Roger Ansell" <notmy@realemailaddress.net> wrote in message
news:e%23EZXi4$HHA.4200@TK2MSFTNGP04.phx.gbl...
>
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
>> Roger,
>> Thanks for the help. Have tried as you suggested and the application
>> still remains on the taskbar when run in Vista. Will have to keep
>> digging.
>> Tony
>
> OK, try experimenting with ...
>
> oWord.WindowState = 1 && and ...
> oWord.Activate
>
> Don't have Vista but even in XP there are circumstances
> where you need both.
>
> -Roger
>
>



Re: Open Word file in Vista by TonySper

TonySper
Tue Sep 25 09:28:31 PDT 2007

Dan,
Yes I have tried Excel and about the same thing. This is also odd. When I
type the command in the command window
oExcel = CreateObject("Excel.Application") it appears that nothing happens
not even on the taskbar, but when you look at the taskmanager you will see
that Excel is running in background. Now type oExcel.Visible = .T. in the
command window and excel is now on the taskbar but not open. The only way I
can get it to open is by clicking on the taskbar. Maybe it has something to
do with my machine or maybe because I am still running Office 2003. I have a
Dell Laptop running Vista Business. I am going to go out now and get Office
2007 and see what happens. Will get back later.
Tony

"Dan Freeman" <spam@microsoft.com> wrote in message
news:ed6mCq4$HHA.3792@TK2MSFTNGP06.phx.gbl...
> Roger Ansell wrote:
>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>> news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
>>> Roger,
>>> Thanks for the help. Have tried as you suggested and the application
>>> still remains on the taskbar when run in Vista. Will have to keep
>>> digging. Tony
>>
>> OK, try experimenting with ...
>>
>> oWord.WindowState = 1 && and ...
>> oWord.Activate
>>
>> Don't have Vista but even in XP there are circumstances
>> where you need both.
>
> And even other circumstances where you have to resort to
> FindWindow()/ShowWindow() API calls.
>
> Tony, do you get the same results from an Excel macro? That would help
> tell us whether this is peculiar to VFP automation or a Vista-in-general
> thing.
>
> I'm starting to get curious enough I may install Vista in a virtual
> machine shortly. I was hoping to put it off a little longer. <g>
>
> Dan
>



Re: Open Word file in Vista by Dan

Dan
Tue Sep 25 11:48:29 PDT 2007

Excel has always started in stealth mode. I used to tell people it was
cloaked like a Romulan Warbird.

That's not the test I wanted you to do, anyway. Write an Excel macro that
instantiates *Word* to see if it acts the same way.

Automation has changed in some way with EACH AND EVERY release of Windows.

Dan

TonySper wrote:
> Dan,
> Yes I have tried Excel and about the same thing. This is also odd.
> When I type the command in the command window
> oExcel = CreateObject("Excel.Application") it appears that nothing
> happens not even on the taskbar, but when you look at the taskmanager
> you will see that Excel is running in background. Now type
> oExcel.Visible = .T. in the command window and excel is now on the
> taskbar but not open. The only way I can get it to open is by
> clicking on the taskbar. Maybe it has something to do with my machine
> or maybe because I am still running Office 2003. I have a Dell Laptop
> running Vista Business. I am going to go out now and get Office 2007
> and see what happens. Will get back later. Tony
>
> "Dan Freeman" <spam@microsoft.com> wrote in message
> news:ed6mCq4$HHA.3792@TK2MSFTNGP06.phx.gbl...
>> Roger Ansell wrote:
>>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>>> news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
>>>> Roger,
>>>> Thanks for the help. Have tried as you suggested and the
>>>> application still remains on the taskbar when run in Vista. Will
>>>> have to keep digging. Tony
>>>
>>> OK, try experimenting with ...
>>>
>>> oWord.WindowState = 1 && and ...
>>> oWord.Activate
>>>
>>> Don't have Vista but even in XP there are circumstances
>>> where you need both.
>>
>> And even other circumstances where you have to resort to
>> FindWindow()/ShowWindow() API calls.
>>
>> Tony, do you get the same results from an Excel macro? That would
>> help tell us whether this is peculiar to VFP automation or a
>> Vista-in-general thing.
>>
>> I'm starting to get curious enough I may install Vista in a virtual
>> machine shortly. I was hoping to put it off a little longer. <g>
>>
>> Dan



Re: Open Word file in Vista by Dan

Dan
Tue Sep 25 11:49:56 PDT 2007

I wondered why you were using .Application -- this makes sense now. Your
object reference isn't Word itself, it's the document.

Dan

TonySper wrote:
> Roger,
> Been trying it all. Do you know that oWord.Windowstate = 1 creates an
> error but oWord.Application.Windowstate = 1 is OK.
> Also oWord.Visible = .T. creates an error but
> oWord.Application.Visible = .T. is OK. This is crazy trying to make
> an application that has been running for 9 years on DOS all the way
> to XP but not on Vista. If they are going to change the Automation you
> would think there
> would be some articles or data around about it.
> Tony
>
> "Roger Ansell" <notmy@realemailaddress.net> wrote in message
> news:e%23EZXi4$HHA.4200@TK2MSFTNGP04.phx.gbl...
>>
>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>> news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
>>> Roger,
>>> Thanks for the help. Have tried as you suggested and the application
>>> still remains on the taskbar when run in Vista. Will have to keep
>>> digging.
>>> Tony
>>
>> OK, try experimenting with ...
>>
>> oWord.WindowState = 1 && and ...
>> oWord.Activate
>>
>> Don't have Vista but even in XP there are circumstances
>> where you need both.
>>
>> -Roger



Re: Open Word file in Vista by Cy

Cy
Tue Sep 25 16:31:44 PDT 2007

Ok tony, try this. set windowstate to 2 followed by 0. When I do that here
it minimizes and then brings word to the front. This is with word 2003 just
as you are using, I have not tried this with 2007 as of yet but who knows?

--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc.
http://www.metsysinc.com

"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:#gHBn74$HHA.5488@TK2MSFTNGP05.phx.gbl...
> Roger,
> Been trying it all. Do you know that oWord.Windowstate = 1 creates an
> error but oWord.Application.Windowstate = 1 is OK.
> Also oWord.Visible = .T. creates an error but oWord.Application.Visible =
> .T. is OK. This is crazy trying to make an application that has been
> running for 9 years on DOS all the way to XP but not on Vista.
> If they are going to change the Automation you would think there would be
> some articles or data around about it.
> Tony
>
> "Roger Ansell" <notmy@realemailaddress.net> wrote in message
> news:e%23EZXi4$HHA.4200@TK2MSFTNGP04.phx.gbl...
>>
>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>> news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
>>> Roger,
>>> Thanks for the help. Have tried as you suggested and the application
>>> still remains on the taskbar when run in Vista. Will have to keep
>>> digging.
>>> Tony
>>
>> OK, try experimenting with ...
>>
>> oWord.WindowState = 1 && and ...
>> oWord.Activate
>>
>> Don't have Vista but even in XP there are circumstances
>> where you need both.
>>
>> -Roger
>>
>>
>
>

Re: Open Word file in Vista by TonySper

TonySper
Tue Sep 25 20:52:56 PDT 2007

Cy,
I don't know why it works but you did it.

oWord = GetObject('C:\Pifiles\Pimp_Manual.Doc')
oWord.Application.Windowstate = 2
oWord.Application.Visible = .T.
oWord.Application.Activate
oWord.Application.WindowState = 0

I had to put in the .Application or I get errors but the file opend up to
the front.
Thank You, Thank You.
Tony






"Cy Welch" <cywelch@hotmail.com> wrote in message
news:324475C9-FF51-43FC-95F3-7F03CE83A11C@microsoft.com...
> Ok tony, try this. set windowstate to 2 followed by 0. When I do that
> here it minimizes and then brings word to the front. This is with word
> 2003 just as you are using, I have not tried this with 2007 as of yet but
> who knows?
>
> --
> Cy Welch
> Senior Programmer/Analyst
> MetSYS Inc.
> http://www.metsysinc.com
>
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:#gHBn74$HHA.5488@TK2MSFTNGP05.phx.gbl...
>> Roger,
>> Been trying it all. Do you know that oWord.Windowstate = 1 creates an
>> error but oWord.Application.Windowstate = 1 is OK.
>> Also oWord.Visible = .T. creates an error but oWord.Application.Visible =
>> .T. is OK. This is crazy trying to make an application that has been
>> running for 9 years on DOS all the way to XP but not on Vista.
>> If they are going to change the Automation you would think there would be
>> some articles or data around about it.
>> Tony
>>
>> "Roger Ansell" <notmy@realemailaddress.net> wrote in message
>> news:e%23EZXi4$HHA.4200@TK2MSFTNGP04.phx.gbl...
>>>
>>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>>> news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
>>>> Roger,
>>>> Thanks for the help. Have tried as you suggested and the application
>>>> still remains on the taskbar when run in Vista. Will have to keep
>>>> digging.
>>>> Tony
>>>
>>> OK, try experimenting with ...
>>>
>>> oWord.WindowState = 1 && and ...
>>> oWord.Activate
>>>
>>> Don't have Vista but even in XP there are circumstances
>>> where you need both.
>>>
>>> -Roger
>>>
>>>
>>
>>



Re: Open Word file in Vista by Dan

Dan
Wed Sep 26 08:29:15 PDT 2007

The reason you need .Application is because you're "getting" an object
reference to the document, not to Word itself.

Dan

TonySper wrote:
> Cy,
> I don't know why it works but you did it.
>
> oWord = GetObject('C:\Pifiles\Pimp_Manual.Doc')
> oWord.Application.Windowstate = 2
> oWord.Application.Visible = .T.
> oWord.Application.Activate
> oWord.Application.WindowState = 0
>
> I had to put in the .Application or I get errors but the file opend
> up to the front.
> Thank You, Thank You.
> Tony
>
>
>
>
>
>
> "Cy Welch" <cywelch@hotmail.com> wrote in message
> news:324475C9-FF51-43FC-95F3-7F03CE83A11C@microsoft.com...
>> Ok tony, try this. set windowstate to 2 followed by 0. When I do
>> that here it minimizes and then brings word to the front. This is
>> with word 2003 just as you are using, I have not tried this with
>> 2007 as of yet but who knows?
>>
>> --
>> Cy Welch
>> Senior Programmer/Analyst
>> MetSYS Inc.
>> http://www.metsysinc.com
>>
>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>> news:#gHBn74$HHA.5488@TK2MSFTNGP05.phx.gbl...
>>> Roger,
>>> Been trying it all. Do you know that oWord.Windowstate = 1 creates
>>> an error but oWord.Application.Windowstate = 1 is OK.
>>> Also oWord.Visible = .T. creates an error but
>>> oWord.Application.Visible = .T. is OK. This is crazy trying to
>>> make an application that has been running for 9 years on DOS all
>>> the way to XP but not on Vista. If they are going to change the
>>> Automation you would think there
>>> would be some articles or data around about it.
>>> Tony
>>>
>>> "Roger Ansell" <notmy@realemailaddress.net> wrote in message
>>> news:e%23EZXi4$HHA.4200@TK2MSFTNGP04.phx.gbl...
>>>>
>>>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>>>> news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
>>>>> Roger,
>>>>> Thanks for the help. Have tried as you suggested and the
>>>>> application still remains on the taskbar when run in Vista. Will
>>>>> have to keep digging.
>>>>> Tony
>>>>
>>>> OK, try experimenting with ...
>>>>
>>>> oWord.WindowState = 1 && and ...
>>>> oWord.Activate
>>>>
>>>> Don't have Vista but even in XP there are circumstances
>>>> where you need both.
>>>>
>>>> -Roger



Re: Open Word file in Vista by tim_witort

tim_witort
Wed Sep 26 10:05:07 PDT 2007

Dan Freeman seemed to utter in
news:Osr1qS6$HHA.1164@TK2MSFTNGP02.phx.gbl:

> Excel has always started in stealth mode. I used to tell people it was
> cloaked like a Romulan Warbird.

That should reinforce your nerd status!

-- TRW
_______________________________________
t i m . w i t o r t
_______________________________________

Re: Open Word file in Vista by Dan

Dan
Wed Sep 26 11:31:16 PDT 2007

Tim Witort wrote:
> Dan Freeman seemed to utter in
> news:Osr1qS6$HHA.1164@TK2MSFTNGP02.phx.gbl:
>
>> Excel has always started in stealth mode. I used to tell people it
>> was cloaked like a Romulan Warbird.
>
> That should reinforce your nerd status!

PLEASE!

That's geek to you. <g>

Dan



Re: Open Word file in Vista by TonySper

TonySper
Wed Sep 26 12:50:43 PDT 2007

Dan,
Thanks for explaining the need for Application. Nerd does not fit you. You
have always been a great help to me.
Tony

"Dan Freeman" <spam@microsoft.com> wrote in message
news:OadzAIFAIHA.4828@TK2MSFTNGP04.phx.gbl...
> The reason you need .Application is because you're "getting" an object
> reference to the document, not to Word itself.
>
> Dan
>
> TonySper wrote:
>> Cy,
>> I don't know why it works but you did it.
>>
>> oWord = GetObject('C:\Pifiles\Pimp_Manual.Doc')
>> oWord.Application.Windowstate = 2
>> oWord.Application.Visible = .T.
>> oWord.Application.Activate
>> oWord.Application.WindowState = 0
>>
>> I had to put in the .Application or I get errors but the file opend
>> up to the front.
>> Thank You, Thank You.
>> Tony
>>
>>
>>
>>
>>
>>
>> "Cy Welch" <cywelch@hotmail.com> wrote in message
>> news:324475C9-FF51-43FC-95F3-7F03CE83A11C@microsoft.com...
>>> Ok tony, try this. set windowstate to 2 followed by 0. When I do
>>> that here it minimizes and then brings word to the front. This is
>>> with word 2003 just as you are using, I have not tried this with
>>> 2007 as of yet but who knows?
>>>
>>> --
>>> Cy Welch
>>> Senior Programmer/Analyst
>>> MetSYS Inc.
>>> http://www.metsysinc.com
>>>
>>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>>> news:#gHBn74$HHA.5488@TK2MSFTNGP05.phx.gbl...
>>>> Roger,
>>>> Been trying it all. Do you know that oWord.Windowstate = 1 creates
>>>> an error but oWord.Application.Windowstate = 1 is OK.
>>>> Also oWord.Visible = .T. creates an error but
>>>> oWord.Application.Visible = .T. is OK. This is crazy trying to
>>>> make an application that has been running for 9 years on DOS all
>>>> the way to XP but not on Vista. If they are going to change the
>>>> Automation you would think there
>>>> would be some articles or data around about it.
>>>> Tony
>>>>
>>>> "Roger Ansell" <notmy@realemailaddress.net> wrote in message
>>>> news:e%23EZXi4$HHA.4200@TK2MSFTNGP04.phx.gbl...
>>>>>
>>>>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>>>>> news:u1VDnT4$HHA.3400@TK2MSFTNGP03.phx.gbl...
>>>>>> Roger,
>>>>>> Thanks for the help. Have tried as you suggested and the
>>>>>> application still remains on the taskbar when run in Vista. Will
>>>>>> have to keep digging.
>>>>>> Tony
>>>>>
>>>>> OK, try experimenting with ...
>>>>>
>>>>> oWord.WindowState = 1 && and ...
>>>>> oWord.Activate
>>>>>
>>>>> Don't have Vista but even in XP there are circumstances
>>>>> where you need both.
>>>>>
>>>>> -Roger
>
>



Re: Open Word file in Vista by tim_witort

tim_witort
Mon Oct 01 09:12:17 PDT 2007

Dan Freeman seemed to utter in news:u8UxttGAIHA.5312@TK2MSFTNGP02.phx.gbl:

> Tim Witort wrote:
>> Dan Freeman seemed to utter in
>> news:Osr1qS6$HHA.1164@TK2MSFTNGP02.phx.gbl:
>>
>>> Excel has always started in stealth mode. I used to tell people it
>>> was cloaked like a Romulan Warbird.
>>
>> That should reinforce your nerd status!
>
> PLEASE!
>
> That's geek to you. <g>

Deepest apolgies, sir Geek. At least you don't include episode
names and a synopsis of the plot when you mention the cloaking. :^)

-- TRW
_______________________________________
t i m . w i t o r t
_______________________________________

Re: Open Word file in Vista by Dan

Dan
Mon Oct 01 10:12:15 PDT 2007

Tim Witort wrote:
>>>> Excel has always started in stealth mode. I used to tell people it
>>>> was cloaked like a Romulan Warbird.
>>>
>>> That should reinforce your nerd status!
>>
>> PLEASE!
>>
>> That's geek to you. <g>
>
> Deepest apolgies, sir Geek. At least you don't include episode
> names and a synopsis of the plot when you mention the cloaking. :^)

No need. That line always got a huge laugh at conference sessions and user
groups. LOL

Dan