#Define wdTableFormatColorful1 8 #Define wdTableFormatColorful2 9 #Define wdTableFormatColorful3 10 #Define wdTableFormatColumns1 11 #Define wdTableFormatColumns2 12 #Define wdTableFormatColumns3 13 #Define wdTableFormatColumns4 14 #Define wdTableFormatColumns5 15 #Define wdTableFormatContemporary 35 lcSQL = "select last_name, first_name, title, country from employee" * Prepare DSN string cDSN = [DSN=Visual FoxPro Database;SourceDB=]+_samples+[\data\testdata.dbc]+; [;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;]+; [Null=Yes;Deleted=Yes;] *** 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..." && Inform user oWordDocument=createobject("word.application") && Create word object With oWordDocument .Documents.Add With .ActiveDocument .Range.InsertDatabase(,,,cDSN,lcSQL) * Set the heading row fieldnames to a suitable format With .tables(1) _SetCellHeading(1,"Employee's Last Name") _SetCellHeading(2,"Employee's First Name") _SetCellHeading(3,"Employee's Title") _SetCellHeading(4,"Country") .Autoformat(wdTableFormatColorful1) Endwith Endwith Wait clear .visible = .t. Endwith **** Set the LocaleId to the previous value =sys(3006,val(nlLocaleId)) Wait clear && Clear wait windows if any * Change Row1, tnColumn text to tcValue Function _SetCellHeading Lparameters tnColumn, tcValue With .Cell(1,tnColumn) .Range.Delete .Range.InsertAfter(tcValue) EndwithCetin