![]() |
#1
|
|||
|
|||
![]()
Can I change printer's paper size and orientation from Corel VBA?
Thank you |
#3
|
|||
|
|||
![]()
Is there any way around this? i.e. is there a way to change what the default settings are for a driver to make them that way permanently? Or can you zap some storage location?
|
#4
|
||||
|
||||
![]() Quote:
|
#5
|
|||
|
|||
![]()
I am no Win32 API guru, but does this page have any helpful info? It shows how to change to duplex from a word document print routine:
http://support.microsoft.com/default...=vbb#appliesto I am looking to change the tray to Tray 1 and paper thinkness to Cardstock (?dmMedia) via the DEVMODE API. If anyone figures it out, let me know! Thanks P.S. I know this is VB but it does look like they create a Word object prior to changing the settings, so maybe it could be used for Corel as well (e.g. since they appear to change the settings after object created, maybe this call will work while the app is active???). |
#6
|
||||
|
||||
![]()
Feel free to try that however I'm thinking it won't work. Try this:
1. Go to Printers folder in windows and change a setting in your default printer (e.g. the page size) 2. Start CorelDRAW and create a new document, add some object to the page 3. Go to File>Print and check the settings of the printer (page size). It should be what you have set up in Windows. 4. Now with Draw still running go back to Windows and change the page size to something else. 5. Return to Draw and check the printer page now. I'm pretty sure it will be the old size. That's because CorelDRAW keeps a copy of all print settings for the printer while it is running so changing the printer settings (either through Control Panel or programmaically by opening a printer and changing some data) won't affect the data used by CorelDRAW. But I would be glad if I'm wrong on this because I like many others would surely want to have this ability to change printer settings from VBA. |
#7
|
|||
|
|||
![]()
i have been working on this myself (off and on for quite a while) and had come to the same conclusion as Alex. Corel won't get the new size when it's changed if corel is open. I have yet to come up with anything viable myself but I had 2 thoughts that brought me here this morning.
1) can a gms module or something be programmed to make this change from within corel or will the same as above apply? i don't thinks so but wondering what people thought here. 2) my other thought is very convoluted but might work. alex basically said the same thing above, just didn't think of re-opening corel. here goes a brief explanation. i need to set the page size to 1 of 2 options depending on what's on my document. the settings for the pages are custom setting, which doesn't make it any easier, as i can't use the vb printer objects properties and have to go with api. so here is my thought. after corel completes the graphic(s), i get the appropriate dimensions needed to define the custom paper size that i need and save to some variable. i then convert the corel doc to an adobe acrobat file. acrobat can be controlled through vb, much like corel. set the appropriate page size, open the pdf in acrobat and print. now the question, why do the intermediate pdf step when the doc could just be re-opened in corel as alex stated above? i haven't come up with any other options and i have looked, searched and asked questions everywhere. |
#8
|
|||
|
|||
![]()
after brainstorming this morning further with the other developer here (and a thanks for alex for clarifying what corel was or wasn't doing), this is the route that i'm going to pursue here.
i will know what paper size i will need before i open corel by a couple of parameters that will be used to build the graphics. by checking this parameter before i open corel, i can determine what printer/paper size i need and change it then. then open corel, build graphics, print, close corel and change the printer back to what it was before. i'm thinking about actually setting up a couple of printers, using the same printer but setting different default paper sizes for them. then all i have to do is change the printer from within vb before i start corel. thanks everyone for giving me some ideas. ![]() |
#9
|
||||
|
||||
![]()
I just got some good news that printer page size will be directly exposed through object model in Draw 12:
Class PrintSettings Properties:
Sounds promising! |
#10
|
|||
|
|||
![]() Quote:
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|