changing printer.papersize=vbPRPSLetter

  • Thread starter Thread starter areddy
  • Start date Start date
A

areddy

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,
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
 
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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top