Hi Graham,
User has been using this for awhile and while it works most of the time, she
ocassionally (40% of the time) is getting this message:
Margins of section 1 are set outsude of printable area. Continue?
When she selects 'Yes', nothing prints on the envelope.
When I test to a different printer, an HP also, it works fine.
Ideas ?
I am using option 1 of running a macro.
Here is the code of macro:
Dim sCurrentPrinter As String
sCurrentPrinter = ActivePrinter
ActivePrinter = "HP LaserJet 2100 Series PCL 6 on LPT1:"
Application.PrintOut FileName:=""
Options.PrintBackground = False
Dim sAddress As String
MsgBox "Insert envelope in printer", vbInformation, "Print Envelope"
With ActiveDocument
If .ProtectionType <> wdNoProtection Then
.Unprotect Password:=""
End If
sAddress = .FormFields("Contact").Result & vbCr & _
.FormFields("Name1").Result & vbCr & _
.FormFields("Name2").Result & vbCr & _
.FormFields("Name3").Result
.Envelope.Insert ExtractAddress:=False, OmitReturnAddress:= _
False, PrintBarCode:=False, PrintFIMA:=False,
Height:=CentimetersToPoints _
(10.48), Width:=CentimetersToPoints(24.13),
Address:=sAddress, AddressFromLeft:=CentimetersToPoints(9.22), _
AddressFromTop:=CentimetersToPoints(3.73),
ReturnAddressFromLeft:= _
wdAutoPosition, ReturnAddressFromTop:=wdAutoPosition,
DefaultOrientation _
:=wdCenterLandscape, DefaultFaceUp:=True
.PrintOut Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="0"
.Sections(1).Range.Delete
.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End With
Options.PrintBackground = True
ActivePrinter = sCurrentPrinter
End Sub
Any idea?
Thanks,
Bryan