B
Bobmeister
Howdy,
Where I work, we have a problem printing to envelope printers. So we
use the code below to allow the user to select the address in the letter and
with macro tell Word to just print to the envelope without first checking to
see if there is an envelope printer present.
Sub BobEnvelopePrinter()
'
' Written by Bob
Application.ScreenUpdating = False
With activedocument.Bookmarks
.Add Range:=Selection.Range, Name:="EnvelopeAddress"
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.HomeKey Unit:=wdStory
activedocument.Envelope.Insert Size:="Size 10"
activedocument.Envelope.FeedSource = wdPrinterEnvelopeFeed
activedocument.Envelope.PrintOut ExtractAddress:=True, OmitReturnAddress
_
:=False, PrintBarCode:=True, FeedSource:=True, Size:="Size 10", _
ReturnAddress:="", AddressFromLeft:=100, _
AddressFromTop:=100, ReturnAddressFromLeft:=wdAutoPosition, _
ReturnAddressFromTop:=wdAutoPosition,
DefaultOrientation:=wdLeftLandscape _
, DefaultFaceUp:=True
activedocument.Sections.First.Range.Delete
Selection.MoveRight Unit:=wdCharacter, Count:=1
Application.ScreenUpdating = True
Beep
End Sub
Now we are experiencing a new problem as we are testing a new image that
is comprised of Windows 2000 running Office 2000. Now when we use that code
above, it prints the first line of the address twice Once at the top of
the address of the envelope and once at the bottom of the address of the
envelope. I.E
Ralph Cramden
1 Bonnie Meadow Road
Portland ME 04112
Ralph Cramden
I ran the code above and stopped it just before printing the envelope. The
code properly creates a fresh section at the top of the document and formats
the paper of that new section to be an envelope. However when the
"PrintOut' command runs, the problem we see above appears on the printed
envelope. The first line prints twice.
We did not have this problem running Windows NT 4 with Office 97. When
we run Windows 2000 with Office 2000 SP1 one of the testers always gets this
lousey result. The other tester experiences the double printing
sporatically and we are still looking for a pattern regarding when it occurs
with the second tester. We use PCL 5 and tried printing to a HP8000 and an
HP8150 and got the same result.
So we are at a loss as to what would/could be the cause and how to fix it
.. Any insights on this would be appreciated. If you with to reach me
directly, my address is at @juno.com with the username
bobmeister2
Bob T.
Where I work, we have a problem printing to envelope printers. So we
use the code below to allow the user to select the address in the letter and
with macro tell Word to just print to the envelope without first checking to
see if there is an envelope printer present.
Sub BobEnvelopePrinter()
'
' Written by Bob
Application.ScreenUpdating = False
With activedocument.Bookmarks
.Add Range:=Selection.Range, Name:="EnvelopeAddress"
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.HomeKey Unit:=wdStory
activedocument.Envelope.Insert Size:="Size 10"
activedocument.Envelope.FeedSource = wdPrinterEnvelopeFeed
activedocument.Envelope.PrintOut ExtractAddress:=True, OmitReturnAddress
_
:=False, PrintBarCode:=True, FeedSource:=True, Size:="Size 10", _
ReturnAddress:="", AddressFromLeft:=100, _
AddressFromTop:=100, ReturnAddressFromLeft:=wdAutoPosition, _
ReturnAddressFromTop:=wdAutoPosition,
DefaultOrientation:=wdLeftLandscape _
, DefaultFaceUp:=True
activedocument.Sections.First.Range.Delete
Selection.MoveRight Unit:=wdCharacter, Count:=1
Application.ScreenUpdating = True
Beep
End Sub
Now we are experiencing a new problem as we are testing a new image that
is comprised of Windows 2000 running Office 2000. Now when we use that code
above, it prints the first line of the address twice Once at the top of
the address of the envelope and once at the bottom of the address of the
envelope. I.E
Ralph Cramden
1 Bonnie Meadow Road
Portland ME 04112
Ralph Cramden
I ran the code above and stopped it just before printing the envelope. The
code properly creates a fresh section at the top of the document and formats
the paper of that new section to be an envelope. However when the
"PrintOut' command runs, the problem we see above appears on the printed
envelope. The first line prints twice.
We did not have this problem running Windows NT 4 with Office 97. When
we run Windows 2000 with Office 2000 SP1 one of the testers always gets this
lousey result. The other tester experiences the double printing
sporatically and we are still looking for a pattern regarding when it occurs
with the second tester. We use PCL 5 and tried printing to a HP8000 and an
HP8150 and got the same result.
So we are at a loss as to what would/could be the cause and how to fix it
.. Any insights on this would be appreciated. If you with to reach me
directly, my address is at @juno.com with the username
bobmeister2
Bob T.