#DEFINE wdStory 6 #DEFINE wdpagebreak 7 #DEFINE wdLine 5 * --- look for Word Template IF FILE(m.lcTemplate) LOCAL loWord AS WORD.APPLICATION * --- try to start Word WAIT WINDOW NOWAIT 'Starting Microsoft Word.' TRY loWord = CREATEOBJECT("word.application") WAIT WINDOW NOWAIT 'Creating Word document. Please wait.' loDocOutPut = loWord.Documents.Add() m.lnRecCount = 0 SCAN m.lnRecCount = m.lnRecCount + 1 loDoc = loWord.Documents.Add(FULLPATH(m.lcTemplate)) WITH loDoc * we will assume the bookmarks in the document * use the names of the fields FOR EACH loBookmark IN .Bookmarks loRange = loBookmark.Range() loRange.Text = EVALUATE('myTable' + loBookmark.name) ENDFOR .Select ENDWITH WITH loWord * copy the selected text and paste into output document .Selection.Copy loDocOutput.Select .Selection.MoveDown(wdLine,1) IF m.lnRecCount > 1 .Selection.InsertBreak(wdPageBreak) ENDIF .Selection.PasteAndFormat(0) loDoc.close(.F.) ENDWITH ENDSCAN loDocOutput.SaveAs(m._OutputFile) loWord.Selection.HomeKey(wdStory) loWord.visible = .T. WAIT CLEAR CATCH TO loError MESSAGEBOX( TRANSFORM(loError.Errorno) + ":" + loError.message ) loWord.Quit RELEASE loWord ENDTRY ELSE MESSAGEBOX( 'The Word mail merge file ' + m.lcTemplate + ' could not be found. Inform System Manager.') ENDIF>I am desiging a new product that needs to give the user the ability to create a letter template and allow for the user to insert variables who's source comes from a table. I know Word has a mail merge function built into