![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
http://bytes.com/topic/access/answer...rinter-setting s http://support.microsoft.com/default...b;en-us;210283 http://bytes.com/topic/access/answer...user-defined-p aper-sizes |
#12
| |||
| |||
|
|
Salad <salad (AT) oilandvinegar (DOT) com> wrote in news:Q8adnePRUK31VzLRnZ2dnUVZ_h-dnZ2d (AT) earthlink (DOT) com: http://bytes.com/topic/access/answer...rinter-setting s http://support.microsoft.com/default...b;en-us;210283 http://bytes.com/topic/access/answer...user-defined-p aper-sizes The second of those links is for the old-fashioned PrtDevMode method of controlling the printer, which is vastly more complicated and fussy than using the new Printer object. I also see from the first link there that each form has it's own Printer object, and when I use the object browser, I find that every form and report has it's own printer object. My guess is that you need to set that instead of the Application.Printer object (though I'd expect the form/report Printer object to inherit settings from the Application.Printer object, though saved settings would no doubt override the inherited properties). So far as I can tell, these properties can be set in an MDE/ACCDE, but obviously cannot be saved. Where this is done, I'm not sure -- in the report's OnOpen event? Or in code after opening the report? -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
#13
| |||
| |||
|
|
Salad <salad (AT) oilandvinegar (DOT) com> wrote in news:Q8adnePRUK31VzLRnZ2dnUVZ_h-dnZ2d (AT) earthlink (DOT) com: http://bytes.com/topic/access/answer...rinter-setting s http://support.microsoft.com/default...b;en-us;210283 http://bytes.com/topic/access/answer...user-defined-p aper-sizes The second of those links is for the old-fashioned PrtDevMode method of controlling the printer, which is vastly more complicated and fussy than using the new Printer object. I also see from the first link there that each form has it's own Printer object, and when I use the object browser, I find that every form and report has it's own printer object. My guess is that you need to set that instead of the Application.Printer object (though I'd expect the form/report Printer object to inherit settings from the Application.Printer object, though saved settings would no doubt override the inherited properties). So far as I can tell, these properties can be set in an MDE/ACCDE, but obviously cannot be saved. Where this is done, I'm not sure -- in the report's OnOpen event? Or in code after opening the report? -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
#14
| |||
| |||
|
|
Bob Darlington wrote: I changed the code to: Application.Printer = Application.Printers("Cheque Printer") Application.Printer.PaperSize = acPRPSUser Application.Printer.ItemSizeHeight = 5301 Application.Printer.ItemSizeWidth = 15252 Application.Printer.PaperBin = acPRBNTractor Application.Printer.BottomMargin = 1 Application.Printer.TopMargin = 1 Application.Printer.LeftMargin = 1 Application.Printer.RightMargin = 1 Application.Printer.Orientation = acPRORPortrait MsgBox Application.Printer.ItemSizeWidth & vbNewLine & _ Application.Printer.ItemSizeHeight & vbNewLine & _ Application.Printer.PaperBin & vbNewLine & _ Application.Printer.BottomMargin & vbNewLine & _ Application.Printer.TopMargin & vbNewLine & _ Application.Printer.LeftMargin & vbNewLine & _ Application.Printer.RightMargin & vbNewLine & _ Application.Printer.Orientation & vbNewLine & _ Application.Printer.PaperSize With the following result: 15252 5301 8 1 1 1 1 1 256 So it is accepting the new values, but not using them when I subsequently open the report (in Preview or normal). Whilst I want to be able to use this in a distributed mde, this testing is still being done in the mdb, so the mde is not the problem (yet). For testing purposes, the 'Cheque' report I am trying to print, is set in design mode to use the specific printer 'Cheque Printer' and paper size 'A4'. If I set the paper size to the custom for the report, it works OK in the mdb, but when I load the mde to the client PC, it resets to A4 -hence the need for this code. My current work around is to load the mdb to the client, open it in TS and reset the paper size, then make the mde on the client PC. I was hoping to overcome this cumbersome approach. Hi Bob: Hmmm...I was thinking that you said it worked if you set it manually. So I think you would like to know the values when it works. Not the above setting the values and then doing a display. I'm not sure where you got the initial values to set them to. Here's a link to MS's site. It's less than you have. Slightly different. Not as many value changes. http://support.microsoft.com/kb/284286 |
#15
| |||
| |||
|
|
I've taken out the decimal points and changed the code to work on the report's printer object to no avail. It still wants to revert to 'Letter' paper size, but I can't see where it takes that value from. |
#16
| |||
| |||
|
|
"Bob Darlington" <bob (AT) notheredpcman (DOT) com.au> wrote in news:4cb39932$0$32441$afc38c87 (AT) news (DOT) optusnet.com.au: I've taken out the decimal points and changed the code to work on the report's printer object to no avail. It still wants to revert to 'Letter' paper size, but I can't see where it takes that value from. You know, I recently had a case where I couldn't get Word to print on index cards to a printer that it had been working with for years when it was using a parallel cable instead of USB. I ended up changing a bunch of settings for the printer setup that finally allowed me to change the paper size in Word and print successfully. My point is simply that perhaps there's something wrong with the configuration of this particular printer that's preventing your coded changes from taking. -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
#17
| |||
| |||
|
|
Thanks David. I tried different ports (LPT1, USB etc and even Print to File) without luck. Still opens in 'Letter' size. How old is your printer? Troubleshooting this on the newsgroup is free |
#18
| |||
| |||
|
|
Bob Darlington wrote: Thanks David. I tried different ports (LPT1, USB etc and even Print to File) without luck. Still opens in 'Letter' size. How old is your printer? Troubleshooting this on the newsgroup is free except for your time. After a while the cost of a new printer that works would be more cost effective than working with a printer that is obstinate. Maybe contact your printer mfg. Maybe see if there are newer drivers. |
#19
| |||
| |||
|
|
I tried different ports (LPT1, USB etc and even Print to File) without luck. Still opens in 'Letter' size. |
#20
| |||
| |||
|
|
"Bob Darlington" <bob (AT) notheredpcman (DOT) com.au> wrote in news:4cb4e1a7$0$3032$afc38c87 (AT) news (DOT) optusnet.com.au: I tried different ports (LPT1, USB etc and even Print to File) without luck. Still opens in 'Letter' size. If I recall correctly, in my case, it also had something to do with the Windows Print Spooler. With a networked printer, as opposed to directly connected (as was the case when I encountered the problem), I don't know if that's possible or not. -- David W. Fenton http://www.dfenton.com/ contact via website only http://www.dfenton.com/DFA/ |
![]() |
| Thread Tools | |
| Display Modes | |
| |