>Hi all
>
>I have a question.
>
>Is it possible to insert intoi a VFP form an instance of MS Word (like an activex) so that the VFP app acts like a word processor?
>
>I know how to create an external instance of Word using CREATEOBJECT and then making it Visible. But this opens a session of word in its own window.
>
>I want to open it within the VFP _Screen or in a VFP form.
>
>I tried using INSERTOBJECT("myword","word.document.8") but this just gives me the ability to edit the document, not save it!
>
>What I need is some way of using word in VFP so that VFP now has its own word processor!
>
>Thanks
>
>Bernard
Bernard,
There is at least one way but I'm not sure it's worth the trouble. Word is not as flexible as excel when doing this (you can show excel menu and toolbars easily but I couldn't with word - meaning you would create your own toolbar if you can't either) :
oForm = Createobject('myForm')
oForm.Show
Read Events
Define Class myForm As Form
Height = 600
Width = 800
Add Object wbrowser As OleControl ;
with top = 10, Height = 550, Width = 800, ;
OleClass = 'Shell.Explorer'
Procedure Init
Local lcDoc, oWord
lcDoc = Sys(5)+Curdir()+'myBase.Doc'
StrToFile('',lcDoc)
With This.wbrowser
.Silent = .t.
.Navigate2(lcDoc)
DO while .ReadyState # 4
EndDo
EndWith
EndProc
Procedure wbrowser.Refresh
Nodefault
Endproc
Procedure QueryUnload
Clear Events
Endproc
Enddefine
Cetin