Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default paper size by name

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default paper size by name

On Jul 6, 9:32 am, Stefi wrote:
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default paper size by name

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


€ť ezt Ă*rta:

On Jul 6, 9:32 am, Stefi wrote:
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default paper size by name

How are you setting the new custom paper size ?

NickHK

"Stefi" wrote in message
...
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


" ezt írta:

On Jul 6, 9:32 am, Stefi wrote:
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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default paper size by name

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:

How are you setting the new custom paper size ?

NickHK

"Stefi" wrote in message
...
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


" ezt Ă*rta:

On Jul 6, 9:32 am, Stefi wrote:
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







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default paper size by name

It would seem that Custom paper info (Forms in Windows) is stored in the
Registry at:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Pr int\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

"Stefi" wrote in message
...
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:

How are you setting the new custom paper size ?

NickHK

"Stefi" wrote in message
...
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


" ezt írta:

On Jul 6, 9:32 am, Stefi wrote:
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







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default paper size by name

That should be :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Forms

NickHK

"NickHK" wrote in message
...
It would seem that Custom paper info (Forms in Windows) is stored in the
Registry at:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Pr int\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

"Stefi" wrote in message
...
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:

How are you setting the new custom paper size ?

NickHK

"Stefi" wrote in message
...
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


" ezt írta:

On Jul 6, 9:32 am, Stefi wrote:
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









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am trying to print on legal size paper, i cant set size. Michele Excel Discussion (Misc queries) 1 December 14th 09 02:44 PM
paper size TQ Excel Discussion (Misc queries) 3 August 4th 09 06:49 AM
how do I set paper size to 11x 17? crand Excel Discussion (Misc queries) 1 June 14th 07 07:03 AM
Paper size. TQ Excel Discussion (Misc queries) 3 April 6th 07 05:12 PM
Paper size Bambi41 Excel Discussion (Misc queries) 1 January 24th 05 10:39 PM


All times are GMT +1. The time now is 07:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"