Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Setup From Code 1

Status
Not open for further replies.

DougAtAvalon

Programmer
Jan 29, 2001
99
US
Is there a way to set the page setup from code

This would help avoid those problems that MS says they took care of

Needed: Margins, Paper Size, Number of columns, Columns width, height.

I just don't know what objects/properties to start with.
I am beginning to think its not possible

-Doug
 
Yes for a report . . .

P.S. At this web site what's the differnec ebetween clicking 'Reply' and 'Next Thread'

-Doug
 
Check out "Set Options from Visual Basic" in the help files. There is an option there to set the margins.

I'm not sure what you mean by number of columns. Aren't your columns defined in your report? Kathryn


 
These options are permanent Tools-Options

What I mean is somehting like

With PageSetup
.RightMargin = ".5"
.LeftMargin = ".4"
.ColumnWidth = "3.5"
etc.
end with

The code above does not work. Like in Word Record Macro then page setup etc, etc

ever heard of it
-Doug
 
There is no other way I know of then to set the margins thru code. Is there a specific reason that you can't manually set the margins?

While the SetOptions does reset the default, if you just stick the original values in some variables (using GetOptions), then SetOptions, print your report and then SetOptions again with the variable values that should work.

Kathryn


 
In a multi-user database, several users (15-20) like to customize the page setup to suit themselves when they send the report to different printers. Like DougAtAvalon, I would like to set the margins at report open to allow everyone to start with a consistent page setup and allow me to use the margins to size complex reports so they fit aesthetically.

CC
 
If you've got multi-users set up a table with their preferences and load them in using SetOptions. It might take some time setting up, but at least you'll keep everyone happy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top