Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation from VFP
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00234127
Message ID:
00234186
Views:
33
>Hello.
>I was looking for a way to to save files as an RTF format after is was created in DOC format.
>
>Looking at the VBA macro and it reads...
>ActiveDocument.SaveAs FileName:="test1.rtf", FileFormat:=wdFormatRTF
>
>So far...
>oWordObj = CREATEOBJECT("Word.Application")
>oWordObj.Documents.Open("C:\WINDOWS\TEMP\MailingO.doc")
>oWordObj.WordBasic.FileSaveAs("C:\WINDOWS\TEMP\MailingO.rtf")
>
>BUT this just puts an exention of RTF still saves in native DOC. I have tried with/endwith for the file format with no luck. Can anybody help. Thanks.

Check the documentation for the place in the parameter list that FileFormat is found, and do something like:
#DEFINE wdFormatRTF 19
oWordObj.ActiveDocument.SaveAs("test1.rtf",,,,,,wdFormatRTF)
You can find the actual value of wdFormatRTF by opening the Visual Basic Editor in Word, then the Object Browser, or you can download my list of constants from the UT Files Section or David Frankenbach's site.
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform