Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Name Address City,State Zip Dear Contact_First_Names:I need to put a CRLF after each field except for the salutation which needs 2 lines.
To insert text use the TypeText Method.
Sample Code:
filetocreate = "C:\temp\WordTemp.doc" oAPP = ObjectCreate("Word.Application") oConstants = ObjectConstantsGet(oAPP) oAPP.Application.visible = @true oAPP.Application.ChangeFileOpenDirectory(FilePath(filetocreate)) oAPP.Application.Documents.Add oActive = oAPP.Application.ActiveDocument oAPP.Application.Selection.Range.EndOf(:: Unit=oConstants.wdStory, Extend=oConstants.wdMove) oAPP.Application.Selection.TypeText("First and Last Name") oAPP.Application.Selection.TypeParagraph ; a @CRLF oAPP.Application.Selection.TypeText("Address") oAPP.Application.Selection.TypeParagraph; a @CRLF oAPP.Application.Selection.TypeText("City, State Zip") oAPP.Application.Selection.TypeParagraph oAPP.Application.Selection.TypeParagraph oAPP.Application.Selection.TypeText("Dear Friend:") Pause("Debugging",StrCat("DONE - Check the contents of the file ",filetocreate)) oAPP.Application.ActiveDocument.SaveAs(StrCat(FileRoot(filetocreate),".",FileExtension(filetocreate))) oAPP.Application.ActiveDocument.Close oAPP.Application.Quit oActive = 0 oApp = 0
Article ID: W16645
File Created: 2005:12:12:16:11:20
Last Updated: 2005:12:12:16:11:20