My objective is to print out n number of envelopes with a return address
only to keep on hand when paying bills.
I've created the following module below, however it invokes the printer
software 'printing' dialog n number of times. Ugly!
I would like to preset the number of copies in a variable in the
ActiveDocument.Envelope.PrintOut function, but I can't
find any options for number of copies.
Does anyone have a better way? I am not a Word programmer.
Thanks in advance,
M. Miller
Sub Envelopes()
'
Dim Message, Title, Default, MyValue
Message = "How many envelopes?" ' Set prompt.
Title = "Number of Envelopes" ' Set title.
Default = "1" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)
MsgBox (CStr(MyValue))
Dim i As Integer
For i = 1 To MyValue
ActiveDocument.Envelope.PrintOut ExtractAddress:=False,
OmitReturnAddress _
:=False, Height:=InchesToPoints(4.13), Width:=InchesToPoints(9.5), _
Address:="", AutoText:="ToolsCreateLabels1", ReturnAddress:= _
"Smothers Brothers", ReturnAutoText:="ToolsCreateLabels2", _
AddressFromLeft:=wdAutoPosition, AddressFromTop:=wdAutoPosition, _
ReturnAddressFromLeft:=wdAutoPosition, ReturnAddressFromTop:= _
wdAutoPosition, DefaultOrientation:=wdCenterClockwise,
DefaultFaceUp:= _
True, PrintEPostage:=False
Next i
End Sub
Doug Robbins - Word MVP - 26 Oct 2007 23:25 GMT
Use the Envelopes and Labels dialog to create the envelope, then click on
the add to document button, which will cause it to be added to the document
as Section 0 and then print out that Section of the document as many times
as you require by using the File>Print dialog and entering the number into
the Copies control.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> My objective is to print out n number of envelopes with a return address
> only to keep on hand when paying bills.
[quoted text clipped - 39 lines]
>
> End Sub
news.epix.net - 27 Oct 2007 15:28 GMT
Doug,
Thanks! I created a module that uses the inputbox() dialog and then set the
number of copies to the input and
assigned it a shortcut key. Simple and elegant.
Regards,
Marc Miller
> Use the Envelopes and Labels dialog to create the envelope, then click on
> the add to document button, which will cause it to be added to the
[quoted text clipped - 45 lines]
>>
>> End Sub