Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE with MS Word
Message
 
À
03/02/1999 11:55:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00183498
Message ID:
00183793
Vues:
15
The documentation for word.basic is available in WRDBASIC.HLP. I think you have to install this as an option in Word / office setup.

In it you will find a section on "Using OLE automation with Word" which tells you how to handle parameters passed rather than 'named arguments' (see "Using Positional Arguments in Visual Basic Version 3.0").

Word.basic is available in both versions of Word, so if you know that your program may be using both it could be a better solution. If you are going to share files between versions, look out for automatic conversions (see the FileOpen documentation).

Finally, in answer to your question, you need to use:-

oleObj.fileOpen("c:\test.doc")

Note that there are a number of work-arounds necessary with OLE automation and Word 6 / 95. An excellent reference is "The Underground Guide to Microsoft Office, OLE and VBA" (Hudspeth & Lee, Addison-Wesley Publishing Company, ISBN 0-201-41035-4) which is both light-hearted and liable to prevent premature greying of the hair (published a little too late to help me).

Hope this helps


>Please, I'm looking for the syntax in VFP6.0 to open Word and a file in Word. I've tried:
> oleObj = CREATEOBJECT("WORD.APPLICATION") this give an error
>
> oleObj = CREATEOBJECT("WORD.BASIC") this does not give an error
>
>
> oleobj.documents.open filename:="c:\test.doc" (an existing doc)
> this gives an error
>
>I've hunted through the documentation and can't find a sample. Please point me in the right direction. Thanks
>
>judy scofield
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform