Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using word as an OLE server form vfp 30b
Message
From
20/09/1996 10:42:07
 
 
To
17/09/1996 09:47:01
General information
Forum:
Microsoft Office
Category:
Word
Miscellaneous
Thread ID:
00007995
Message ID:
00008258
Views:
36
>I am trying to use Word 7.0 as an ole server from within Visual Foxpro 30b
>to do so i give these commands (Can be done in command venster).
>
>lcWordobj = CREATEOBJECT('Word.Basic')
>lcWordobj.Appshow
>lcWordobj.FileNew
>lcWordobj.Fileclose
>lcWordobj.appclose
>
>a new file is created No problems at all.
>
>But now i want to create a new file based on existing templates which can be found from within VFP
>
>lcWordobj = CREATEOBJECT('Word.Basic')
>lcWordobj.Appshow
>lcWordobj.FileNew.Template = 'FAX.DOT'
>
>The following error occurs:
>FileNew does not evaluate to an object member
>
>A new file is created in word but not based on the fax.dot but on normal.dot
>
>I've tried to find the answer to this here:
>1 Developer Network cd
>2 Wrdbasic help from word 7.0
>
>None of these came up with the answer any ideas anyone
Word will inherit the properities of a template automatically. Issue the commands
oword=CreateObject("Word.Basic")
oword.FileNew("TemplateName" ) && The name of the template you want to use
This uses words basic functionality to create a new document based on the template.
When you are done with the document, you can print with the command
oword.FilePrint
or save the file to a new name with:
oword.FileSaveAs("mynewfile.doc")
Notice the slight diifferences to VFP's use of the word basic systax. Shorten the commands so that last variable is referenced as an variable within the object. Once you learn this difference VFP is faster and easier that Visual Basic and C++.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform