Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Printout method

Status
Not open for further replies.

stucoo

IS-IT--Management
Oct 31, 2003
6
GB
Hi,

I'm using the following code print out the name and address onto an envelope, but I keep receiving run time error 462 if the code is run more than once. It always fails at the printout method. Also I would like to use the Addressfromleft option, but I am unable to get it to work. Can anyone help ?

With objWord

Set rng = objWord.ActiveDocument.Bookmarks("Name").Range
rng.End = objWord.ActiveDocument.Bookmarks("Address").Range.End
.ActiveDocument.Bookmarks.Add _
Name:="EnvelopeAddress", _
Range:=rng
rng.Font.Size = 12
ActiveDocument.Envelope.PrintOut , , , , , , , , , , , , , AddressFromTop:=CentimetersToPoints(3.1)

End With

Thanks
 
Something like this ?
With objWord
Set rng = .ActiveDocument.Bookmarks("Name").Range
rng.End = .ActiveDocument.Bookmarks("Address").Range.End
.ActiveDocument.Bookmarks.Add _
Name:="EnvelopeAddress", _
Range:=rng
rng.Font.Size = 12
[highlight].[/highlight]ActiveDocument.Envelope.PrintOut AddressFromTop:=[highlight].[/highlight]CentimetersToPoints(3.1)
End With

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top