J
JamesW
I have the following macro that used to work for our
Laserjet 5si however we have changed the printer for a
Laserjet 4200 and the macro prints the whole document to
tray 1 rather than first page to tray 1 and other pages to
tray 3. Printing to the LJ5N works fine. I have tried
installing the driver on the local machine with no
difference. Any help would be appreciated.
Sub Fourcopy()
'
' Fourcopy Macro
'
ActivePrinter = "\\admin2000\envhlth_4200tn1"
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.Gutter = InchesToPoints(0)
Rem .HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.27)
.PageHeight = InchesToPoints(11.69)
.FirstPageTray = wdPrinterUpperBin
.OtherPagesTray = wdPrinterLowerBin
.SectionStart = wdSectionNewPage
Rem .OddAndEvenPagesHeaderFooter = False
Rem .DifferentFirstPageHeaderFooter = True
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
End With
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=False,
PrintToFile:=False
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or
ActiveWindow. _
ActivePane.View.Type = wdOutlineView Or
ActiveWindow.ActivePane.View.Type _
= wdMasterView Then
ActiveWindow.ActivePane.View.Type = wdPageView
End If
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
End If
Selection.ParagraphFormat.Alignment =
wdAlignParagraphRight
Selection.Font.Size = 8
Selection.TypeParagraph
Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, Text:= _
"FILENAME \p ", PreserveFormatting:=True
ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
ActivePrinter = "\\admin2000\envhlth_LJ5N"
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.Gutter = InchesToPoints(0)
Rem .HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.27)
.PageHeight = InchesToPoints(11.69)
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterLowerBin
.SectionStart = wdSectionNewPage
Rem .OddAndEvenPagesHeaderFooter = False
Rem .DifferentFirstPageHeaderFooter = True
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
End With
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=False,
PrintToFile:=False
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.Gutter = InchesToPoints(0)
Rem .HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.27)
.PageHeight = InchesToPoints(11.69)
.FirstPageTray = wdPrinterUpperBin
.OtherPagesTray = wdPrinterUpperBin
.SectionStart = wdSectionNewPage
Rem .OddAndEvenPagesHeaderFooter = False
Rem .DifferentFirstPageHeaderFooter = True
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
End With
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=False,
PrintToFile:=False
ActivePrinter = "\\admin2000\envhlth_LJ5"
End Sub
..
Laserjet 5si however we have changed the printer for a
Laserjet 4200 and the macro prints the whole document to
tray 1 rather than first page to tray 1 and other pages to
tray 3. Printing to the LJ5N works fine. I have tried
installing the driver on the local machine with no
difference. Any help would be appreciated.
Sub Fourcopy()
'
' Fourcopy Macro
'
ActivePrinter = "\\admin2000\envhlth_4200tn1"
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.Gutter = InchesToPoints(0)
Rem .HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.27)
.PageHeight = InchesToPoints(11.69)
.FirstPageTray = wdPrinterUpperBin
.OtherPagesTray = wdPrinterLowerBin
.SectionStart = wdSectionNewPage
Rem .OddAndEvenPagesHeaderFooter = False
Rem .DifferentFirstPageHeaderFooter = True
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
End With
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=False,
PrintToFile:=False
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or
ActiveWindow. _
ActivePane.View.Type = wdOutlineView Or
ActiveWindow.ActivePane.View.Type _
= wdMasterView Then
ActiveWindow.ActivePane.View.Type = wdPageView
End If
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
If Selection.HeaderFooter.IsHeader = True Then
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageFooter
Else
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
End If
Selection.ParagraphFormat.Alignment =
wdAlignParagraphRight
Selection.Font.Size = 8
Selection.TypeParagraph
Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, Text:= _
"FILENAME \p ", PreserveFormatting:=True
ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
ActivePrinter = "\\admin2000\envhlth_LJ5N"
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.Gutter = InchesToPoints(0)
Rem .HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.27)
.PageHeight = InchesToPoints(11.69)
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterLowerBin
.SectionStart = wdSectionNewPage
Rem .OddAndEvenPagesHeaderFooter = False
Rem .DifferentFirstPageHeaderFooter = True
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
End With
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=False,
PrintToFile:=False
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.Gutter = InchesToPoints(0)
Rem .HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.27)
.PageHeight = InchesToPoints(11.69)
.FirstPageTray = wdPrinterUpperBin
.OtherPagesTray = wdPrinterUpperBin
.SectionStart = wdSectionNewPage
Rem .OddAndEvenPagesHeaderFooter = False
Rem .DifferentFirstPageHeaderFooter = True
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
End With
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=False,
PrintToFile:=False
ActivePrinter = "\\admin2000\envhlth_LJ5"
End Sub
..