Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report Output in MS WORD compatible format
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00143142
Message ID:
00143244
Views:
27
>Hello,
>
>I need to convert VFP report outputs into MS Word format (or compatible, i.e. RTF).

Well, it's not the easiest way to do it, but you could use OLE Automation to actually create a Word document. It's done essentially the same way as you would have done an @...SAY style report.
loWord = CREATEOBJECT('Word.Application')
loWord.Visible = .T.            && Only so you can see what it's doing
loWord.Documents.Add()
loDoc = loWord.ActiveDocument   && Maybe these two lines can be combined
loWord.Selection.TypeText('This is my text')
WAIT WINDOW "Press any key to close Word"
loDoc.Close(wdSaveChanges)
loWord.Quit()
If you install the VB help files when you install Office 97, you'll get a complete reference of all the commands. The Word reference is called vbaWrd8.hlp, and it's in Program Files\Microsoft Office\Office (by default).
My blog
My consulting page
My home page

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

Click here to load this message in the networking platform