How to set page length in Word for label printing to Canon Printer

C

Commjo

We have an existing macro that used to work fine on Word under Windows
98.

The macro takes highlighted text, copies it to a new page, then prints
it to a label on a different printer which is a different page size to
the default page.

After we upgraded some machines to XP, the pagelength setting does not
work anymore, and the page continues to scroll on (to A4 length).

No matter what we do we cannot get it to work.

Your help is appreciated.

Here is the macro

***************************
Sub MAIN()
'
' AutoExit.main Macro
' Macro created 14/11/2003 by NEC Computers International
'

End Sub
Sub newlabel1()

'
' Macro to print address labels from a different printer.
' To use: highlight the address in the document and invoke the
' macro either from the toolbar or from the Tools Menu
'
' Remember to change the printer type and page size if different from
' those set up in the current macro Also the other printer must be
' connected to a different print queue in the control panel, and may
be declared
' as being attached to the LPT2: port. This saves having to change
queues in the macro
'
WordBasic.EditCopy
WordBasic.WW7_EditGoTo Destination:="\ENDOFDOC"
WordBasic.InsertBreak Type:=2
WordBasic.EditPaste
WordBasic.CharLeft 1, 0
WordBasic.WW7_EditGoTo Destination:="\SECTION"

With Selection.Font
.Name = "Tahoma"
.Size = 12
.Bold = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
End With

With Selection.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(0.89)
.BottomMargin = CentimetersToPoints(0)
.LeftMargin = CentimetersToPoints(6.35)
.RightMargin = CentimetersToPoints(0.76)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(0)
.FooterDistance = CentimetersToPoints(0)
.PageWidth = CentimetersToPoints(14)
.PageHeight = CentimetersToPoints(8)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.GutterPos = wdGutterPosLeft
End With

ActivePrinter = "Canon Bubble-Jet BJC-5500"
WordBasic.FilePrint Type:=0, NumCopies:="1", Range:=2, From:="",
To:="", PrintToFile:=0, _
Collate:=1, FileName:=""
WordBasic.EditCut
WordBasic.FilePageSetup Tab:=1, ApplyPropsTo:=0, TopMargin:="0.5" + _
Chr(34), BottomMargin:="0.38" + Chr(34), LeftMargin:="0.7" + Chr(34),
RightMargin:= _
"0.3" + Chr(34), Gutter:="0" + Chr(34), FacingPages:=0,
PageWidth:="8.27" + _
Chr(34), PageHeight:="11.69" + Chr(34), Orientation:=0, FirstPage:=0,
_
OtherPages:=0
WordBasic.WW6_EditClear -1
WordBasic.WW7_EditGoTo Destination:="\STARTOFDOC"
WordBasic.WW2_FormatCharacter Font:="Times New Roman", Points:="10",
Bold:=0, Italic:=0, _
Strikeout:=0, Hidden:=0, SmallCaps:=0, AllCaps:=0, Underline:=0,
Color:=0, Position:= _
"0 pt", Spacing:="0 pt"

ActivePrinter = "\\NT_MANC_01\SHARP AR-285 PCL5e"
End Sub

*****************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top