hi,
In windows-98 i can set
printer.papersize = 256 ' vbcustom
printer.height = somevalue
but in win2000/professional the same code gives invalid property error and set the paper size to letter i .e. 1
pl. help
Printable View
hi,
In windows-98 i can set
printer.papersize = 256 ' vbcustom
printer.height = somevalue
but in win2000/professional the same code gives invalid property error and set the paper size to letter i .e. 1
pl. help
The PaperSize property syntax has these parts:
Part Description
Object Anobject expression that evaluates to an object in the Applies To list.
Value A value or constant specifying the paper size, as described in Settings.
Settings
The settings for value are:
Constant Value Description
vbPRPSLetter 1 Letter, 8 1/2 x 11 in.
vbPRPSLetterSmall 2 Letter Small, 8 1/2 x 11 in.
vbPRPSTabloid 3 Tabloid, 11 x 17 in.
vbPRPSLedger 4 Ledger, 17 x 11 in.
vbPRPSLegal 5 Legal, 8 1/2 x 14 in.
vbPRPSStatement 6 Statement, 5 1/2 x 8 1/2 in.
vbPRPSExecutive 7 Executive, 7 1/2 x 10 1/2 in.
vbPRPSA3 8 A3, 297 x 420 mm
vbPRPSA4 9 A4, 210 x 297 mm
vbPRPSA4Small 10 A4 Small, 210 x 297 mm
vbPRPSA5 11 A5, 148 x 210 mm
vbPRPSB4 12 B4, 250 x 354 mm
vbPRPSB5 13 B5, 182 x 257 mm
vbPRPSFolio 14 Folio, 8 1/2 x 13 in.
vbPRPSQuarto 15 Quarto, 215 x 275 mm
vbPRPS10x14 16 10 x 14 in.
vbPRPS11x17 17 11 x 17 in.
vbPRPSNote 18 Note, 8 1/2 x 11 in.
vbPRPSEnv9 19 Envelope #9, 3 7/8 x 8 7/8 in.
vbPRPSEnv10 20 Envelope #10, 4 1/8 x 9 1/2 in.
vbPRPSEnv11 21 Envelope #11, 4 1/2 x 10 3/8 in.
vbPRPSEnv12 22 Envelope #12, 4 1/2 x 11 in.
vbPRPSEnv14 23 Envelope #14, 5 x 11 1/2 in.
vbPRPSCSheet 24 C size sheet
vbPRPSDSheet 25 D size sheet
vbPRPSESheet 26 E size sheet
vbPRPSEnvDL 27 Envelope DL, 110 x 220 mm
vbPRPSEnvC3 29 Envelope C3, 324 x 458 mm
vbPRPSEnvC4 30 Envelope C4, 229 x 324 mm
vbPRPSEnvC5 28 Envelope C5, 162 x 229 mm
vbPRPSEnvC6 31 Envelope C6, 114 x 162 mm
vbPRPSEnvC65 32 Envelope C65, 114 x 229 mm
vbPRPSEnvB4 33 Envelope B4, 250 x 353 mm
vbPRPSEnvB5 34 Envelope B5, 176 x 250 mm
vbPRPSEnvB6 35 Envelope B6, 176 x 125 mm
vbPRPSEnvItaly 36 Envelope, 110 x 230 mm
vbPRPSEnvMonarch 37 Envelope Monarch, 3 7/8 x 7 1/2 in.
vbPRPSEnvPersonal 38 Envelope, 3 5/8 x 6 1/2 in.
vbPRPSFanfoldUS 39 U.S. Standard Fanfold, 14 7/8 x 11 in.
vbPRPSFanfoldStdGerman 40 German Standard Fanfold, 8 1/2 x 12 in.
vbPRPSFanfoldLglGerman 41 German Legal Fanfold, 8 1/2 x 13 in.
vbPRPSUser 256 User-defined
Remarks
These constants are listed in the Visual Basic (VB)object library in theObject Browser.
Setting a printer's Height or Width property automatically sets PaperSize to vbPRPSUser.
Note The effect of the properties of the Printer object depends on the driver supplied by the printer manufacturer. Some property settings may have no effect, or several different property settings may all have the same effect. Settings outside the accepted range may or may not produce an error. For more information, see the manufacturer's documentation for the specific driver.
Printer Object Constants
Printer Color Mode
Constant Value Description
vbPRCMMonochrome 1 Monochrome output
vbPRCMColor 2 Color output
Duplex Printing
Constant Value Description
vbPRDPSimplex 1 Single-sided printing
vbPRDPHorizontal 2 Double-sided horizontal printing
vbPRDPVertical 3 Double-sided vertical printing
Printer Orientation
Constant Value Description
vbPRORPortrait 1 Documents print with the top at the narrow side of the paper
vbPRORLandscape 2 Documents print with the top at the wide side of the paper
Print Quality
Constant Value Description
vbPRPQDraft -1 Draft print quality
vbPRPQLow -2 Low print quality
vbPRPQMedium -3 Medium print quality
vbPRPQHigh -4 High print quality
PaperBin Property
Constant Value Description
vbPRBNUpper 1 Use paper from the upper bin
vbPRBNLower 2 Use paper from the lower bin
vbPRBNMiddle 3 Use paper from the middle bin
vbPRBNManual 4 Wait for manual insertion of each sheet of paper
vbPRBNEnvelope 5 Use envelopes from the envelope feeder
vbPRBNEnvManual 6 Use envelopes from the envelope feeder, but wait for manual insertion
vbPRBNAuto 7 (Default) Use paper from the current default bin
vbPRBNTractor 8 Use paper fed from the tractor feeder
vbPRBNSmallFmt 9 Use paper from the small paper feeder
vbPRBNLargeFmt 10 Use paper from the large paper bin
vbPRBNLargeCapacity 11 Use paper from the large capacity feeder
vbPRBNCassette 14 Use paper from the attached cassette cartridge
PaperSize Property
Constant Value Description
vbPRPSLetter 1 Letter, 8 1/2 x 11 in
vbPRPSLetterSmall 2 +A611Letter Small, 8 1/2 x 11 in
vbPRPSTabloid 3 Tabloid, 11 x 17 in
vbPRPSLedger 4 Ledger, 17 x 11 in
vbPRPSLegal 5 Legal, 8 1/2 x 14 in
vbPRPSStatement 6 Statement, 5 1/2 x 8 1/2 in
vbPRPSExecutive 7 Executive, 7 1/2 x 10 1/2 in
vbPRPSA3 8 A3, 297 x 420 mm
vbPRPSA4 9 A4, 210 x 297 mm
vbPRPSA4Small 10 A4 Small, 210 x 297 mm
vbPRPSA5 11 A5, 148 x 210 mm
vbPRPSB4 12 B4, 250 x 354 mm
vbPRPSB5 13 B5, 182 x 257 mm
vbPRPSFolio 14 Folio, 8 1/2 x 13 in
vbPRPSQuarto 15 Quarto, 215 x 275 mm
vbPRPS1&H14 16 10 x 14 in
vbPRPS11x17 17 11 x 17 in
vbPRPSNote 18 Note, 8 1/2 x 11 in
vbPRPSEnv9 19 Envelope #9, 3 7/8 x 8 7/8 in
vbPRPSEnv10 20 Envelope #10, 4 1/8 x 9 1/2 in
vbPRPSEnv11 21 Envelope #11, 4 1/2 x 10 3/8 in
vbPRPSEnv12 22 Envelope #12, 4 1/2 x 11 in
vbPRPSEnv14 23 Envelope #14, 5 x 11 1/2 in
vbPRPSCSheet 24 C size sheet
vbPRPSDSheet 25 D size sheet
vbPRPSESheet 26 E size sheet
vbPRPSEnvDL 27 Envelope DL, 110 x 220 mm
vbPRPSEnvC3 29 Envelope C3, 324 x 458 mm
vbPRPSEnvC4 30 Envelope C4, 229 x 324 mm
vbPRPSEnvC5 28 Envelope C5, 162 x 229 mm
vbPRPSEnvC6 31 Envelope C6, 114 x 162 mm
vbPRPSEnvC65 32 Envelope C65, 114 x 229 mm
vbPRPSEnvB4 33 Envelope B4, 250 x 353 mm
vbPRPSEnvB5 34 Envelope B5, 176 x 250 mm
vbPRPSEnvB6 35 Envelope B6, 176 x 125 mm
vbPRPSEnvItaly 36 Envelope, 110 x 230 mm
vbPRPSEnvMonarch 37 Envelope Monarch, 3 7/8 x 7 1/2 in
vbPRPSEnvPersonal 38 Envelope, 3 5/8 x 6 1/2 in
vbPRPSFanfoldUS 39 U.S. Standard Fanfold, 14 7/8 x 11 in
vbPRPSFanfoldStdGerman 40 German Standard Fanfold, 8 1/2 x 12 in
vbPRPSFanfoldLglGerman 41 German Legal Fanfold, 8 1/2 x 13 in
vbPRPSUser 256 User-defined
thanks for this help but i think u have not read my problem! it is
In windows-98 i can set
printer.papersize = 256 ' vbcustom
printer.height = somevalue
i am already using this ode suesfully in win98 but i wish to migrate to win2k server/prof. and when i run the above code it gives error. this is i believe because in win2kserver/prof/xp the printer r not having ustom paper option.
pl. help
Is the printer in win98 and win2000 the same? Perhaps you need to install the printer driver you are using in win98 to that win2000....
hey dee
wihout installing the printer this code won't work there is no question of printer installation/working.
i believe the problem is in printer drivers for win2k server/xp/prof. nt technology doesn't support custom paper size. do u have any work around for this. :afrog:
Perhaps on win98 you have Hp and win2000 you have another...
Perhaps you are from the later cat, not to understand that i understand the basics to ask such a question. :cry:Quote:
Originally Posted by dee-u