Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Surely, someone has done this! dbf into MSWord ?
Message
From
24/07/1998 17:19:44
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/07/1998 17:05:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00121205
Message ID:
00121211
Views:
19
>I am trying to insert a table into Word97. I had no problems using the macro recorder to learn how to insert a text file, bold, center, etc. However, when I used the recorder for inserting a database, the
>syntax was not clear on how I would use that in VFP. Does anyone have any examples of inserting a table into Word?
>
>Any comments would be much appreciated.
>
>TIA
>
>Piper
Piper,
You could use insertdatabase command (word) but there is a simplier one :
PUBLIC oWordDocument
*** set the LOCALEID to English
nlLocaleId=sys(3004)		&& Save local id
=sys(3006,1033)				&& We will be sending instructions in English 
wait window nowait "Creating Word Document..."

oWordDocument=createobject("word.basic")	&& Create word object
with oWordDocument
	.appshow							&& Show word app - Word 7.0 support
	.filenewdefault        				&& New file, default template
	SELECT * FROM customer into cursor tcTemp
	application.datatoclip("tcTemp",reccount("customer"),3) 
	.editpaste
	.StartOfDocument(1)
	.texttotable(1,15,,,0)
endwith
wait clear

**** Set the LocaleId to the previous value
=sys(3006,val(nlLocaleId))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform