Configure print setting forqueries and reports using VBA in access

H

HelpNeeded

Hi All,
I am trying to configure print setting using vba in access. I used the
following code in excel. IT works, can i use a similar kind of code in access
vba to confiugre print setting. So that any time a query is executed and the
report needs to be printed, it should automatically take a predefined print
settings. please help. Thanks.
Code used in Excel follow:
Sub Macro1()
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "&BPersonal Confidential&B"
.CenterFooter = "&D"
.RightFooter = "Page &P"
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(1)
.PrintHeadings = True
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
End Sub
 
H

HelpNeeded

Thanks for replying. the link is very informative. However, I am trying to
change print setup settings using vb. Can you please help?
 

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