Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening word document embedded in a general field
Message
From
04/01/2003 09:11:20
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00737898
Message ID:
00738011
Views:
24
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform