WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Word

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Print an Envelope from Word


I use this to print an envelope for my Expense reports.

Steve Romine

recep = Strcat("My Company", @CRLF, "999 Maplewood Ln.", @CRLF, "Anytown, TN. 37923", @CRLF, "Attn: Accounts Payable")
objWord = ObjectOpen("Word.Application")
objWord.Visible = @FALSE
objDocs = objWord.Documents
objDocs.Add
objActiveDoc=objWord.ActiveDocument
objActiveDoc.Activate
objEnvelope = objActiveDoc.Envelope
;if you don't specify ReturnAddress, it uses the useraddress in Word.
objEnvelope.Printout(::Address=recep, ReturnAddress="Anywhere", Size="Size 10", PrintBarCode=0) 

While objWord.BackgroundPrintingStatus > 0
Timedelay(.5)
End While

objActiveDoc.Close()
objWord.Quit()
ObjectClose(objActiveDoc)
ObjectClose(objDocs)
ObjectClose(objWord) 



Article ID:   W16146
File Created: 2004:03:30:15:43:00
Last Updated: 2004:03:30:15:43:00