Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing into a word document
Message
 
To
26/11/2002 13:19:04
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00727141
Message ID:
00727262
Views:
10
You may want to check out the VFP Automation book from Hentzenwerke. Here is some code that may (or may not) help -- the typetext method can be a little slow.
*********************
#DEFINE cr chr(13)
#DEFINE vbtab chr(9)
#DEFINE wdToggle  9999998
#DEFINE wdAlignParagraphLeft  0

oword=create('word.application')
oword.documents.add()
oword.caption='Audit Report Test'


WITH oword
	.Selection.typetext(cr+cr)
	.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
	.SELECTION.Font.Size = 12
	.Selection.typetext("Audit No:  ")
	.SELECTION.Font.Bold = wdToggle
	.Selection.typetext(alltrim(m.lcAudit_id))
	.SELECTION.Font.Bold = wdToggle
	.Selection.typetext(vbtab+vbtab+vbtab)
	.SELECTION.Font.Bold = .t.
	.Selection.typetext("Audit Date: ")
	.SELECTION.Font.Bold = .f.
	.Selection.typetext(vbtab+vbtab+mdy(audits.date_audit))

etc, etc....
endwith

oword.visible= .t.
=Release oword
Kevin Emmrich
www.jkt9000.com
Previous
Reply
Map
View

Click here to load this message in the networking platform