473,507 Members | 8,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change paper size with VBA code?

12 New Member
Hi Guys

I have a small issue with page setup, you know that in page setup there is a printer paper, and drawing page, I know how to change the printer paper but I need also to change the drawing page to be same as printer paper size.
I have used those codes to do this but still missing the code to make the drawing page to be same as a printer paper size, and also to change the drawing page orientation to be landscape!!!
can you please help me with this?


Expand|Select|Wrap|Line Numbers
  1.  
  2. vsDoc.PaperSize = visPaperSizeA3
  3. vsDoc.PrintLandscape = True
  4. vsDoc.PrintScale = 1
  5. vsDoc.PrintCenteredH = True
  6. vsDoc.PrintCenteredV = True
  7. Set vsPage = vsDoc.Pages(1)
  8. vsPage.PageSheet.CellsU("PrintPageOrientation").Formula = "2"
  9.  


Those codes will change the printer paper only, I need to change the drawing page as well!!!

Thank you in advance for your help...

Regards
Jun 7 '12 #1
0 1521

Sign in to post your reply or Sign up for a free account.

Similar topics

5
7459
by: Brian DSouza | last post by:
I got the following code from an earlier posting (much earlier, like 1999) in this ng. This is supposed to control the paper size selected to legal, even if the default printer changes. Question is...
0
1730
by: Todd | last post by:
I have a mix of reports that are designed to print on either legal or letter size paper. When a legal sized report is first viewed in Print Preview, Page Setup uses the default Window printer's...
0
5625
by: Larry | last post by:
Hi my friends, I'm writing a small program to print a form. The form is on customer sized paper. I trying to use following code to change paper size, but it dosn't work. Why?? There's always an...
2
1288
by: **Developer** | last post by:
THIS IS WHAT I DO: Dim lG As Graphics = pD.PrinterSettings.CreateMeasurementGraphics() Dim lHdc As IntPtr = lG.GetHdc() leftOffsetP = GetDeviceCaps(lHdc, PHYSICALOFFSETX) topOffsetP =...
0
1399
by: william.reynolds | last post by:
I am producing reports (via Crystal XI) on a web server. I use a variety of paper sizes in Crystal to produce PDF output. In development everything works fine since I can change the paper size...
0
1214
by: Sukh | last post by:
Hi, I am tring to change the paper size from default to custom paper size. In print preview its showing my custom size but when I print it print on default paper size. Can any one help me to...
6
12409
by: Brewtzaff | last post by:
Hello, I have a little problem to print my reports on custom sized paper. I got a db containing clubmembers, a query which selects only the needed infos to print out my membershipcards. My...
1
9908
by: Anne DeBlois | last post by:
Hi, I want to programatically set the paper size of a print document. I created a class that inherits PrintDocument, so I can print some database records on 8" x 10" paper. I added this line...
0
1573
by: luqman | last post by:
I want to change my paper size while previewing the report in ASP.Net and VS 2005, which I have defined in Server Properties of my Windows XP Pro, my Paper size is defined by the name of :...
3
5239
by: CD Tom | last post by:
I have a report that can fix on letter size paper of on legal size depending on the number of columns that is printed on the report. I would like to change the paper size in the program depending on...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.