TonySper
2010-05-03 16:39:10 UTC
I have been using the following to open up a Word file in VFP8 so that it is
viewable and does not end up on the task bar were a user has to click on it
in the task bar to open it up.
IF OS(3) = '6' && OS IS VISTA
oWORD = CREATEOBJECT('Word.Application')
WITH oWORD
.APPLICATION.VISIBLE = .T.
.DOCUMENTS.OPEN('C:\VFP_TESTS\ATTORNEY.DOC')
.APPLICATION.WINDOWSTATE = 2
.APPLICATION.WINDOWSTATE = 0
ENDWITH
ELSE
oWord = CREATEOBJECT("Word.Application")
oWord.Documents.OPEN('C:\VFP_TESTS\ATTORNEY.DOC')
WITH oWord
.Application.WindowState = 1
.Application.Visible = .T.
ENDWITH
ENDIF
The problem now is that this does not work in Windows 7 as the Word program
ends up on the task bar and now the user has to click on the task bar to
open the word file up. Has anyone been able to open up a word file and have
it visible on the screen without having to click on the task bar to open it
up?
It looks like the OS(3) comes back with a 5 but have not found the
combination to view word.
Thanks for any suggestions.
TonySper
viewable and does not end up on the task bar were a user has to click on it
in the task bar to open it up.
IF OS(3) = '6' && OS IS VISTA
oWORD = CREATEOBJECT('Word.Application')
WITH oWORD
.APPLICATION.VISIBLE = .T.
.DOCUMENTS.OPEN('C:\VFP_TESTS\ATTORNEY.DOC')
.APPLICATION.WINDOWSTATE = 2
.APPLICATION.WINDOWSTATE = 0
ENDWITH
ELSE
oWord = CREATEOBJECT("Word.Application")
oWord.Documents.OPEN('C:\VFP_TESTS\ATTORNEY.DOC')
WITH oWord
.Application.WindowState = 1
.Application.Visible = .T.
ENDWITH
ENDIF
The problem now is that this does not work in Windows 7 as the Word program
ends up on the task bar and now the user has to click on the task bar to
open the word file up. Has anyone been able to open up a word file and have
it visible on the screen without having to click on the task bar to open it
up?
It looks like the OS(3) comes back with a 5 but have not found the
combination to view word.
Thanks for any suggestions.
TonySper