Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ActiveX Automation, Word 97, Saving Documents
Message
From
22/05/1997 19:28:03
 
 
To
19/05/1997 12:11:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00032621
Message ID:
00033350
Views:
45
>>>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.
>>
>>Did you try FileSaveAs instead of SaveAs?
>
>I tried that and got 'unknown name'. SaveAs is definitely the new method name. FileSaveAs was the name under the old Word.Basic object model.
>
>Thanks,
>
>Randy


Are you sure oDoc.SaveAs() worked? I could not get this to work.
How about printing? I have been trying all kinds of options and cannot get
any combination of selecting a printer and printing a file to work. Any ideas?

-Isaac
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform