paper size by name

G

Guest

Hi All,

When I use custom paper size, first I define it for the printer by
submitting its name and page lenght and width. Windows assigns to it a code
number, and when I record a macro printing on this paper size, the macro
contains this code number, like
..PaperSize = 125
It's hard to remember to code numbers. Is there any way in VBA to refer to a
custom paper size by its name?

Thanks,
Stefi
 
M

meh2030

Hi All,

When I use custom paper size, first I define it for the printer by
submitting its name and page lenght and width. Windows assigns to it a code
number, and when I record a macro printing on this paper size, the macro
contains this code number, like
.PaperSize = 125
It's hard to remember to code numbers. Is there any way in VBA to refer to a
custom paper size by its name?

Thanks,
Stefi

Stefi,

Search the VBE Help for PaperSize, click the PaperSize Property, and
then when the help box opens, click the blue link labeled
"XlPaperSize".

Matt
 
G

Guest

Hi Matt,

Thanks for your reply, I followed the link you suggested, and found names
for pre-defined paper sizes, and one for user defined size: xlPaperUser, but
there is no help on how to assign a value to this name, and how can I handle
more than one custom paper sizes.
Can you give me some more assistance?

Regards,
Stefi


„[email protected]†ezt írta:
 
G

Guest

Via Windows Control Panel/Printers and Faxes/Printer Properties/General
tag/Printing settings/Paper-Quality tag/Custom Paper Size

Sorry if some words don't match the originals, I'm tanslating them back from
Hungarian.

Stefi


„NickHK†ezt írta:
 
N

NickHK

It would seem that Custom paper info (Forms in Windows) is stored in the
Registry at:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Forms

I'm not sure how these relate to the numbers you set for .PaperSize though.
e.g. For my Acrobat PDF printer, setting papersize to ARCH A ( a custom size
presumably installed by this printer), gives a value of .PaperSize=125.

As there seems no direct link in this area of the registry that I can see,
you may have to resort to the API, specifically using the DEVMODE structure
and get its dmFormName element.
This shows you all you need for dealing with Printers:
http://vb.mvps.org/samples/project.asp?id=PrnInfo

NickHK
 
N

NickHK

That should be :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Forms

NickHK
 

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

Top