custom paper size

M

Mike Kim

Hi there,

I would like to know how to set up PaperSize. Let's say I have a custom
paper designed for barcode label printing and the dimension is 1.25" X 1". I
can set this up manually from Excel by going to File/ Page Setup and
selecing from the dropdown list, which has 1.25" X 1".

I have a VB.net application that creates excel worksheet on the fly.
so far this is what i have

objSheet.PageSetup.PaperSize = Excel.XlPaperSize.------(something)
but there is no 1.25" x 1" paper size in the value list.

any help will be appreciated. thanks
 
T

Tom Ogilvy

I believe you would have to use xlPaperUser

then you would have to set the custom size using the windows API (same as
setting it in the print driver manually)
 
M

Mike Kim

thanks tom.

i tried to use xlPaperUser but gave up after fiddling it for a while. I
could not find any documentation pertaining to this issue. if you know how
to use windows api to accomplish this, can you post some sample codes. i
would appreciate it.
 
K

keepitcool

Mike,

Manipulating the printer settings from the registry is
rather complicated.

It depends on operating system etc etc. A while back i've written an
experimental addin MultiTrayPrint to switch printertrays.

Although unused in the interface a lot of background stuff
(like papersizes, bin to size mapping, etc etc) has been
programmed into classmodules in the addin, and you may be able
to use / adapt it to suit your needs.

The code is NOT documented.. but fairly structered.
It involves some 15 API functions and may be instructive.

Download it from my site and have a look.
http://members.chello.nl/keepitcool/download.html


Any comments appreciated!



keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 

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