Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
ActiveX Automation, Word 97, Saving Documents
Has anybody successfully used Word 97 from VFP with ActiveX Automation? I had no problem creating an object reference, opening Word, and putting information in a new or existing document. Just cannot figure out SaveAs() method.
Docs make it look like only required parameter is the file name, unless you want to change defaults. Well, I did want to save as a word perfect 5.1 file, but I can't get even the basic SaveAs() to work. Example:
odoc = createobject( 'word.document.8')
oDoc.Application.Visible = .t.
oDoc.Words(1).InsertAfter( "Hello, world!")
Now either of these produce Type Mismatch OLE error:
oDoc.SaveAs( "c:\Hello.doc")
oDoc.SaveAs( )
I've tried other variants with no luck. Same syntax in Excel 97 worked fine. Old object model in Word 6 worked fine with Word.Basic and FileSaveAs method.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement