In my application I wnt open open a Word-file and put it on to the screen, so the client can directly input his text into word.
Opening Word is not a problem, but place in on top doesn't work.
Here is a extraction of my code, so you can test is. You have to create a test.doc file in c:\test.
After the window is open, you have to click the window and the word-file will open but..., it is minimized...
Does anyone know the solution to maximize Word
- Code: Select all Expand view
- #INCLUDE "FiveWin.ch"
func test()
local oWnd
DEFINE WINDOW oWnd TITLE 'Click on the window to open word'
ACTIVATE WINDOW oWnd MAXIMIZED ON CLICK openword()
return
func openword()
local oword,oDoc,hWnd
local cFile := 'c:\temp\test.doc'
oWord := TOleAuto():New("Word.Application")
oDoc := oWord:Documents:Open(cFile)
oWord:Visible := .T.
oWord:WindowState := 1
hWnd := FindWindow(0,'test.doc')
if hWnd != nil
BringWindowToTop( hWnd )
endif
return
Thanks,
Marc