>I have an embedded (not linked) Word document in a general field. How can I use “code” to open the embedded word document in MSWord? Can I use “DoVerb”?
>Appreciate suggestions and sample code.
Zafer (A Turkish name meaning victory:)
You can get a copy of doc by using a reference to document object. The copy will not be 100% exact copy of original (OleBoundcontrol size has an impact on pagesetup, summary info like last accessed would changed etc) but visually it'd be almost same. Assuming you have table named 'myWordDocs' with a general field named 'doc' :
local oForm
oForm = Createobject('myForm')
Define Class myForm As Form
Add Object myWord As OleBoundControl ;
With ControlSource = "myWordDocs.doc", Name='myWord', ;
width=800
Procedure Load
Use myWordDocs
Endproc
Procedure Init
With This
Select myWordDocs
Scan
.Refresh()
.myWord.Object.SaveAs(Sys(5)+Curdir()+;
'DOCUMENT_'+Transform(Recno('myWordDocs'))+'.doc')
Endscan
Endwith
Endproc
Enddefine
PS: Note there is no call to form.show. Might be if you want to provide something like a 'Save' button.
Cetin