?
Solved

Setup of Page before Printing

Posted on 2003-03-28
9
Medium Priority
?
410 Views
Last Modified: 2007-12-19
Hi all,

I need to be able to setup my page layout before I print a report... I need to specify somehow:

PageTop = 0.1"                       ' just as an example
PageBottom = 0.1"
PageLeft = .7"
PageRight = .7"

I need it to print Portrait with the default printer....

But I must do this with code, on my print command... can anybody help me ? This is in ACCESS VBA by the way..

Thank You,

Robert Mezei
0
Comment
Question by:originalrobby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 58
ID: 8225538
Which version of Access? For AXP, there is a printer object, which makes doing this a whole lot easier.  For versions before that, I would suggest purchasing On The Fly Printing by ATTAC Consulting (http://ourworld.compuserve.com/homepages/attac-cg/) or purchasing a book, which includes sample code.

  The reason I say this is that the code is quite lengthy and it would take you a considerable amount of time to come up with it.  OTF printing runs about $100 or so, a book is about $50.  This is one of those cases where you'd spend a lot more trying to come up with it on your own then simply buying it.

Jim.
0
 

Author Comment

by:originalrobby
ID: 8225834
Umm, I have code actually that does this and it is not lengthy at all, only it is in VB.NET.

It is ACCESS 97, VBA 5.0 I believe...

I do indeed need to create a printer object and specify the top, bottom, left and right margins, and somwhow like this:

With Printer                 'how do i define it ?
' Initialize Printer Object
Printer.Orientation = vbPRORPortrait ' ? again not sure
Printer.PrintQuality = 300
Printer.Print ""
               
PageBottom = (.Height + .ScaleHeight) / 2 - 720 ' example


If anyone can help me, please do so, I'd greatly appreciate it, it's going in an database application of 2000+ records
0
 

Author Comment

by:originalrobby
ID: 8225877
Umm, I have code actually that does this and it is not lengthy at all, only it is in VB.NET.

It is ACCESS 97, VBA 5.0 I believe...

I do indeed need to create a printer object and specify the top, bottom, left and right margins, and somwhow like this:

With Printer                 'how do i define it ?
' Initialize Printer Object
Printer.Orientation = vbPRORPortrait ' ? again not sure
Printer.PrintQuality = 300
Printer.Print ""
               
PageBottom = (.Height + .ScaleHeight) / 2 - 720 ' example


If anyone can help me, please do so, I'd greatly appreciate it, it's going in an database application of 2000+ records
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:originalrobby
ID: 8225942
Umm, I have code actually that does this and it is not lengthy at all, only it is in VB.NET.

It is ACCESS 97, VBA 5.0 I believe...

I do indeed need to create a printer object and specify the top, bottom, left and right margins, and somwhow like this:

With Printer                 'how do i define it ?
' Initialize Printer Object
Printer.Orientation = vbPRORPortrait ' ? again not sure
Printer.PrintQuality = 300
Printer.Print ""
               
PageBottom = (.Height + .ScaleHeight) / 2 - 720 ' example


If anyone can help me, please do so, I'd greatly appreciate it, it's going in an database application of 2000+ records
0
 
LVL 58
ID: 8226101
Originalrobby,

  Please don't hit the refresh button, which on EE will cause duplicate posts.  Unlike VB, there is no printer object in A2000 and prior.  The only way to deal with printers is via the PrtDevMode and PrtMip structures.  Handling those can become quite complex.

  It's simply faster/cheaper to buy this code in one form or another.

Jim.
0
 

Author Comment

by:originalrobby
ID: 8226151
Umm, I have code actually that does this and it is not lengthy at all, only it is in VB.NET.

It is ACCESS 97, VBA 5.0 I believe...

I do indeed need to create a printer object and specify the top, bottom, left and right margins, and somwhow like this:

With Printer                 'how do i define it ?
' Initialize Printer Object
Printer.Orientation = vbPRORPortrait ' ? again not sure
Printer.PrintQuality = 300
Printer.Print ""
               
PageBottom = (.Height + .ScaleHeight) / 2 - 720 ' example


If anyone can help me, please do so, I'd greatly appreciate it, it's going in an database application of 2000+ records
0
 

Author Comment

by:originalrobby
ID: 8226169
NOOOOOOOOOO!!!!!!!!!!

Sorry guys, I didnt realize it was reposting it!!!! CR*P!
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 160 total points
ID: 8226447
<<NOOOOOOOOOO!!!!!!!!!!

Sorry guys, I didnt realize it was reposting it!!!! CR*P!
>>

 quite alright...*everyone* does it sooner or later<g>

Jim.
0
 
LVL 18

Expert Comment

by:1William
ID: 9244760
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept question, points to JDettman
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

1William
EE Cleanup Volunteer
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question