#1   Report Post  
Posted to microsoft.public.word.docmanagement
traineeross traineeross is offline
external usenet poster
 
Posts: 4
Default Printing Macro

I have written a macro to enable me to print on plain paper. The macro
controls the page setup and printing options so they all relate to the tray
with plain paper in.

I have done this for other paper types as well.

However when i try to use them i get an error all regarding one specific
line of text.

The error on all the macros occurs in the second line -- .Orientation =
wdOrientPortrait--

Here is the macro in full, i wrote it by actually performing the actions as
opposed to writting the text.

Sub Plain()
'
' Plain Macro
' Macro recorded 26/06/2007 by jodywilliams
'
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(2)
.BottomMargin = CentimetersToPoints(2)
.LeftMargin = CentimetersToPoints(2)
.RightMargin = CentimetersToPoints(2)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(1.27)
.FooterDistance = CentimetersToPoints(1.27)
.PageWidth = CentimetersToPoints(21)
.PageHeight = CentimetersToPoints(29.7)
.FirstPageTray = 258
.OtherPagesTray = 258
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = True
.MirrorMargins = False
.TwoPagesOnOne = False
.GutterPos = wdGutterPosLeft
End With
With Options
.UpdateFieldsAtPrint = False
.UpdateLinksAtPrint = False
.DefaultTray = " Tray 3"
.PrintBackground = True
.PrintProperties = False
.PrintFieldCodes = False
.PrintComments = False
.PrintHiddenText = False
.PrintDrawingObjects = True
.PrintDraft = False
.PrintReverse = False
.MapPaperSize = True
End With
With ActiveDocument
.PrintPostScriptOverText = False
.PrintFormsData = False
End With
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False,
PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
End Sub

Is there an easy way to overcome this?

Many thanks for your help in advance,

Jody

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Shauna Kelly Shauna Kelly is offline
external usenet poster
 
Posts: 571
Default Printing Macro

Hi

See http://pubs.logicalexpressions.com/P...cle.asp?ID=101. That
article, and those that follow from it, document just about everything you
can do in Word with printers.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"traineeross" wrote in message
...
I have written a macro to enable me to print on plain paper. The macro
controls the page setup and printing options so they all relate to the
tray
with plain paper in.

I have done this for other paper types as well.

However when i try to use them i get an error all regarding one specific
line of text.

The error on all the macros occurs in the second line -- .Orientation =
wdOrientPortrait--

Here is the macro in full, i wrote it by actually performing the actions
as
opposed to writting the text.

Sub Plain()
'
' Plain Macro
' Macro recorded 26/06/2007 by jodywilliams
'
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(2)
.BottomMargin = CentimetersToPoints(2)
.LeftMargin = CentimetersToPoints(2)
.RightMargin = CentimetersToPoints(2)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(1.27)
.FooterDistance = CentimetersToPoints(1.27)
.PageWidth = CentimetersToPoints(21)
.PageHeight = CentimetersToPoints(29.7)
.FirstPageTray = 258
.OtherPagesTray = 258
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = True
.MirrorMargins = False
.TwoPagesOnOne = False
.GutterPos = wdGutterPosLeft
End With
With Options
.UpdateFieldsAtPrint = False
.UpdateLinksAtPrint = False
.DefaultTray = " Tray 3"
.PrintBackground = True
.PrintProperties = False
.PrintFieldCodes = False
.PrintComments = False
.PrintHiddenText = False
.PrintDrawingObjects = True
.PrintDraft = False
.PrintReverse = False
.MapPaperSize = True
End With
With ActiveDocument
.PrintPostScriptOverText = False
.PrintFormsData = False
End With
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False,
PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
End Sub

Is there an easy way to overcome this?

Many thanks for your help in advance,

Jody



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a macro to run a merge and then printing , then save Bruce Mailmerge 1 December 17th 06 05:24 PM
Help needed w/booklet-printing macro, round 2 David Nebenzahl Page Layout 5 March 14th 06 05:19 AM
Help needed: booklet-printing macro not working correctly David Nebenzahl Page Layout 3 March 11th 06 10:43 PM
printing double side from command line macro in MS word Cooz Microsoft Word Help 2 March 10th 06 04:14 PM
printing labels from a form using a macro mary Formatting Long Documents 5 May 14th 05 09:09 AM


All times are GMT +1. The time now is 07:10 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"