View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default 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