Create cursor wtest (wf g) >Append blank >Append general wf from (getfile("DOC")) >lcSampleTable = _samples+"\data\employee" >oform = createobject("form") >With oform > .addobject("olbW","Oleboundcontrol") > .height = 420 > .width = 620 > With .olbW > .top = 10 > .left = 10 > .height = 400 > .width = 600 > .controlsource = "wtest.wf" && "Embedded" word doc > #Define wdSeparateByTabs 1 > #Define wdTableFormatColorful1 8 > #Define wdSaveChanges -1 > #Define wdCollapseEnd 0 > Select first_name, last_name ; > from (lcSampleTable) ; > into cursor myCursor > Application.datatoclip("myCursor",_tally, 3) > With .object > .Content.select > With .Application.Selection > .Collapse(wdCollapseEnd) && Go to end of selection - remove selection > .Text = "Hello from VFP."+chr(13) > .Collapse(wdCollapseEnd) > .Text = _cliptext > .ConvertToTable(wdSeparateByTabs,,,, ; > wdTableFormatColorful1,,,,,,,.f.,,.f.) && Convert to table format Colorful 1 > Endwith > .saveas("c:\temp\savedfromgen.doc") && saved to disk > .close(wdSaveChanges) > Endwith > * .visible = .t. > Endwith > *.Show && If you want to display the form >Endwith >*READ EVENTS && Start event processing - not needed if just process the word object in background and quitCetin