Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WORD.BASIC and OLE Bound Control
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00019605
Message ID:
00019622
Views:
30
>I am having difficulties with OLE automation and MS Word.
>
>I know that in order to access any of the Word functions you have to create the OLE object as Word.Basic and not Word.Document.6. However how do you force the type to be Word.Basic on already existing objects?
>
>For example, I did the following:
>
>APPEND GENERAL worddoc FROM junk.doc CLASS "Word.Basic"
>oForm = CREATEOBJ( "FORM" )
>oForm.ADDOBJECT( "OLEWord", "OLEBOUNDCONTROL" )
>oForm.OLEWord.ControlSource = "DATABASE.worddoc"
>
>I've tried the append with and w/out the quotes. Apparently the system cannot open a document as type word.basic, however I don't know how you can "FileOpen" from a database file w/out having to create a temp file and reappend the file upon completion of the task
>
You are mixing metaphors here if you will. OLE bound control is one thing and OLE automation is another. If all you want to do is print, you don't need the OLE bound control at all.

oform=createobj('word.basic')

then open the file and then print it. See OLE automation examples for word at www.microsoft.com/oledev/oleauto
Todd Burstain, MD
infinitydoc@delphi.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform