ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   changing printer.papersize=vbPRPSLetter (https://www.excelbanter.com/excel-programming/348510-changing-printer-papersize%3Dvbprpsletter.html)

areddy[_28_]

changing printer.papersize=vbPRPSLetter
 

Dear All,

Iam opening an excel file through visualbasic6.0 code with some data
iam filling in the excel file.everything is ok but i want to change the
printer papersize A4 to Letter.
iam setting to Printer.papersize=vbPRPSLetter for Letter in the visual
basic code.

but it is not setting to Printer.papersize =vbPRPSLetter

please helpme on this regard...

Thanks a lot !!!
Amar...


--
areddy
------------------------------------------------------------------------
areddy's Profile: http://www.excelforum.com/member.php...o&userid=28204
View this thread: http://www.excelforum.com/showthread...hreadid=494796


NickHK

changing printer.papersize=vbPRPSLetter
 
areddy,
You are making changes to the Printer object that VB would use. But you are
printing through Excel, I suppose.
So you need to use the .PageSetUp.PaperSize of the worksheet to print to
make such changes.
e.g. Worksheets("Sheet1").PageSetup.PaperSize = xlPaperLetterLetter

<VBA Help
PaperSize Property
Returns or sets the size of the paper. Read/write Long.
Can be one of the following XlPaperSize constants. (Some printers may not
support all of these paper sizes.)

xlPaperLetter Letter (8-1/2 in. x 11 in.)
.............................
xlPaperFanfoldLegalGerman German Legal Fanfold (8-1/2 in. x 13 in.)
xlPaperUser User-defined
</VBA Help

NickHK

"areddy" wrote in
message ...

Dear All,

Iam opening an excel file through visualbasic6.0 code with some data
iam filling in the excel file.everything is ok but i want to change the
printer papersize A4 to Letter.
iam setting to Printer.papersize=vbPRPSLetter for Letter in the visual
basic code.

but it is not setting to Printer.papersize =vbPRPSLetter

please helpme on this regard...

Thanks a lot !!!
Amar...


--
areddy
------------------------------------------------------------------------
areddy's Profile:

http://www.excelforum.com/member.php...o&userid=28204
View this thread: http://www.excelforum.com/showthread...hreadid=494796




areddy[_29_]

changing printer.papersize=vbPRPSLetter
 

Hi Nick,

thanks for fast responce.now iam getting the result iam able to set the
paper size to xlPaperA4 or xlPaperLetter.

once again thanks for the replay.

Regards,
Amar...


--
areddy
------------------------------------------------------------------------
areddy's Profile: http://www.excelforum.com/member.php...o&userid=28204
View this thread: http://www.excelforum.com/showthread...hreadid=494796



All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com