Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing to Custom Size Paper

339 views
Skip to first unread message

Bob Darlington

unread,
Oct 18, 2010, 3:07:56 AM10/18/10
to
I've already explored this through a different 'Subject' line, and received
some helpful replies, but unfortunately I still can't get it to work.
So, my question now is:
Has anybody successfully used code similar to that below to change paper
size to a custom size when printing to specialised forms?

Application.Printer = Application.Printers("Cheque Printer")
DoCmd.OpenReport "rCheque", 2, , "PropNum = " & gblPropNum
Set rpt = Reports!rCheque
With rpt.Printer
.DefaultSize = False
.PaperSize = acPRPSUser
.ItemSizeHeight = 5301
.ItemSizeWidth = 15252
End With

The code runs without generating an error, but invariably opens the report
in 'Letter' paper size.
I have set up a custom paper size called 'Cheque' which I can manually set
and all works fine.
But I need to distribute the app in an mde, so want to change the paper size
when the report is opened as above.
Has anyone got this to work?
--
Bob Darlington
Brisbane


Arvin Meyer

unread,
Oct 18, 2010, 8:51:34 AM10/18/10
to
I would create a custom Printer object that used this paper size and install
it on each user's machine. Then set the report to that specific printer and
save it.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access
Co-author: "Access Solutions", published by Wiley


"Bob Darlington" <b...@notheredpcman.com.au> wrote in message
news:4cbbf236$0$25360$afc3...@news.optusnet.com.au...

Bob Darlington

unread,
Oct 18, 2010, 7:18:38 PM10/18/10
to
Thanks Arvin,
That is what I've got at the moment.
But whenever the users open the report in the mde, the paper size is set to
'Letter'.
I've been using TS to load the program as an mdb, selecting the 'Cheque'
paper size and creating the mde remotely.
It works, but is a pain in the backside.
BTW, I'm using Access 2002.

--
Bob Darlington
Brisbane
"Arvin Meyer" <arv...@invalid.org> wrote in message
news:-9mdnYm4zfNQ3yHR...@earthlink.com...

Tony Toews

unread,
Oct 19, 2010, 5:45:00 PM10/19/10
to
On Mon, 18 Oct 2010 08:51:34 -0400, "Arvin Meyer" <arv...@invalid.org>
wrote:


>I would create a custom Printer object that used this paper size and install
>it on each user's machine. Then set the report to that specific printer and
>save it.

Actually all you need to do is create the printer size on the printer
server which frequently is the file server.

Go into the list of Printers under the Settings button from the Start
menu. You may need to do this on the print server and you might need
admin privilages. Then click on File >> Server Properties Then you
can create a new form with the sizes you want on it as well as a name.

Then you can follow the below steps inside Access to choose the just
created Paper Size. Go into the design of the report, Click
'File',Page Setup', Click the 'Page' tab., Select 'Specific Printer',,
Pick the printer you are using., Click 'Properties' then the 'Paper'
tab., In 'Paper Size' select 'Custom'. and choose your just created
Paper Size.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

Bob Darlington

unread,
Oct 19, 2010, 6:27:41 PM10/19/10
to
Thanks Tony.
That is what I'm doing at the moment.
But when the app is loaded on the client's server, the page size selection
is lost.
I thought that I could overcome this problem using the Printer Object code.

--
Bob Darlington
Brisbane
"Tony Toews" <tto...@telusplanet.net> wrote in message
news:594sb613vvdp3ddfb...@4ax.com...

Tony Toews

unread,
Oct 20, 2010, 1:45:18 AM10/20/10
to
On Wed, 20 Oct 2010 08:27:41 +1000, "Bob Darlington"
<b...@notheredpcman.com.au> wrote:

>That is what I'm doing at the moment.
>But when the app is loaded on the client's server, the page size selection
>is lost.
>I thought that I could overcome this problem using the Printer Object code.

Right but are the users creating that paper size on the clients
printer server?

Bob Darlington

unread,
Oct 20, 2010, 2:09:10 AM10/20/10
to
Yep.

--
Bob Darlington
Brisbane
"Tony Toews" <tto...@telusplanet.net> wrote in message

news:re0tb6902da88ojsl...@4ax.com...

Tony Toews

unread,
Oct 21, 2010, 2:01:24 AM10/21/10
to
On Wed, 20 Oct 2010 16:09:10 +1000, "Bob Darlington"
<b...@notheredpcman.com.au> wrote:

>Yep.

Well, darn then I don't have a clue.

Tony (sorry to be so unhelpful.)

Bob Darlington

unread,
Oct 21, 2010, 3:04:27 AM10/21/10
to
Thanks for trying Tony.
It seems that no-one has successfully used the Printer object for custom
paper sizes.

--
Bob Darlington
Brisbane
"Tony Toews" <tto...@telusplanet.net> wrote in message

news:volvb6lqghla3jhej...@4ax.com...

David-W-Fenton

unread,
Oct 21, 2010, 7:18:47 PM10/21/10
to
"Bob Darlington" <b...@notheredpcman.com.au> wrote in
news:4cbfe5de$0$10379$afc3...@news.optusnet.com.au:

> It seems that no-one has successfully used the Printer object for
> custom paper sizes.

Have you compared this in MDB vs. MDE? I recall that you're trying
to do this in an MDE, and I'm just wondering if that is the source
of the problem.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Bob Darlington

unread,
Oct 21, 2010, 8:45:50 PM10/21/10
to
David,
I'm still testing in the mdb on my development PC and I can't get it to work
there.
Hopefully, if I can get it to work in the mdb, it will (might) work in the
mde at the client site.
That's my goal anyway.
I still haven't heard from anyone who has successfully done so in either
file form.

--
Bob Darlington
Brisbane
"David-W-Fenton" <NoE...@SeeSignature.invalid> wrote in message
news:Xns9E18C477462E8f9...@74.209.136.99...

yanto

unread,
Oct 23, 2010, 4:00:59 AM10/23/10
to
Hi Bob,
I have the similar problem, so far I did what Tony suggested, I go to
client place, setup CUSTOM page on server properties, open my report
in design mode, change pagesize as CUSTOM and recompile it, so far
it's ok, but I prefer to do once a time so I use this way, I put my
report on backend database so you just set once for the custom page
then I call that report from my frontend so now everytime I copy my
modified fron'tend, I don't need to set the pagesize in my client
place even I can email it...but this doesn't works if I use Ms Access
Runtime in my client place
HTH

Yanto

On Oct 22, 7:45 am, "Bob Darlington" <b...@notheredpcman.com.au>
wrote:


> David,
> I'm still testing in the mdb on my development PC and I can't get it to work
> there.
> Hopefully, if I can get it to work in the mdb, it will (might) work in the
> mde at the client site.
> That's my goal anyway.
> I still haven't heard from anyone who has successfully done so in either
> file form.
>
> --
> Bob Darlington

> Brisbane"David-W-Fenton" <NoEm...@SeeSignature.invalid> wrote in message


>
> news:Xns9E18C477462E8f9...@74.209.136.99...
>
>
>
> > "Bob Darlington" <b...@notheredpcman.com.au> wrote in
> >news:4cbfe5de$0$10379$afc3...@news.optusnet.com.au:
>
> >> It seems that no-one has successfully used the Printer object for
> >> custom paper sizes.
>
> > Have you compared this in MDB vs. MDE? I recall that you're trying
> > to do this in an MDE, and I'm just wondering if that is the source
> > of the problem.
>
> > --
> > David W. Fenton                  http://www.dfenton.com/

> > contact via website only    http://www.dfenton.com/DFA/- Hide quoted text -
>
> - Show quoted text -

Phil

unread,
Oct 24, 2010, 3:45:46 AM10/24/10
to

Have you tried the old fashioned method (AK2) using things like PRTMIP &
DEVMODE?

Phil

Bob Darlington

unread,
Oct 24, 2010, 6:33:01 PM10/24/10
to
Phil,
The app is distributed as an mde.

--
Bob Darlington
Brisbane
"Phil" <ph...@stantonfamily.co.uk> wrote in message
news:ia0o79$h3v$1...@speranza.aioe.org...

Bob Darlington

unread,
Oct 24, 2010, 6:36:39 PM10/24/10
to
Thanks Yanto.
Unfortunately, I have a mixture of runtime and non runtime installations.
I hadn't thought about attaching the report to the backend though, so I'll
have a play with that idea.

--
Bob Darlington
Brisbane
"yanto" <yant...@gmail.com> wrote in message
news:0428155f-de19-4e58...@29g2000prb.googlegroups.com...

Phil

unread,
Oct 24, 2010, 7:02:44 PM10/24/10
to
On 24/10/2010 23:33:04, "Bob Darlington" wrote:
> Phil,
> The app is distributed as an mde.
>

Don't think that is a problem

Phil

Bob Darlington

unread,
Oct 24, 2010, 8:02:10 PM10/24/10
to
Phil,
I thought that those methods required the reports to be able to be opened in
design mode, which you can't do in mde.

--
Bob Darlington
Brisbane
"Phil" <ph...@stantonfamily.co.uk> wrote in message

news:ia2duk$e0d$1...@speranza.aioe.org...

Phil

unread,
Oct 25, 2010, 12:18:02 PM10/25/10
to
On 25/10/2010 01:02:12, "Bob Darlington" wrote:
> Phil,
> I thought that those methods required the reports to be able to be opened
> in design mode, which you can't do in mde.
>

Er um deep crimson

Of course you're right

apologies

Phil

Bob Darlington

unread,
Oct 25, 2010, 7:38:16 PM10/25/10
to
Thanks to all for their help on this one.
I've reluctantly come to the conclusion that I can't use the Printer object
to reset a custom paper page size after migrating my front end to the client
PCs, so I've given up on that tack.
Instead, I moved along the line suggested by Yanto (in this thread) and
created a new db to hold the Cheque report with attendant queries, linked
relevant tables to the backend db and loaded it into the user's 'CurrentDir'
folder.
I can then open it with OpenCurrentDatabase as follows:

Set objAccess = New Access.Application
With objAccess
lngRet = apiSetForegroundWindow(.hWndAccessApp)
lngRet = apiShowWindow(.hWndAccessApp, SW_NORMAL)
lngRet = apiShowWindow(.hWndAccessApp, SW_MAXIMIZE)
.OpenCurrentDatabase CurrentDir & "cheques.mdb"
.DoCmd.OpenReport strReport, acViewPreview, , , , gblPropNum
End With


--
Bob Darlington
Brisbane
"Bob Darlington" <b...@notheredpcman.com.au> wrote in message
news:4cbbf236$0$25360$afc3...@news.optusnet.com.au...

0 new messages