(Msg. 2) Posted: Mon Jul 21, 2008 3:00 am
Post subject: Re: Printer Choice [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
"dave" <dave.RemoveThis@accessdatapros.com> wrote in message
news:2E110ACD-554E-436A-ABBF-7D64456FE626@microsoft.com...
> Access 2007
> I want to have a macro that prints a form to .pdf.
> However the .pdf printer is not the default printer.
> Is there anyway to code changing printers?
This example assumes:
- You have the PDF add-in installed. If not, see
http://www.microsoft.com/downloads/details.aspx?familyid=4D951911-3E7E...E6-B059
- You want to save the PDF to your desktop.
- In older versions of Access, the code needs to just show a preview.
- You need to apply a filter (i.e. print one invoice, not all of them.)
- You want the pdf called "InvoiceXXX.pdf" where XXX is the invoice number.
Dim strFile As String
DoCmd.OpenReport "rptInvoice", acViewPreview, , "InvoiceID = " &
Me.InvoiceID
If Val(SysCmd(acSysCmdAccessVer)) >= 12# Then
strFile = Environ("HOMEDRIVE") & Environ("HOMEPATH") & _
"\Desktop\Invoice" & Me.InvoiceID & ".pdf"
DoCmd.OutputTo acOutputReport, strDoc, acFormatPDF, strFile, True
End If
If that's not what you want, it is possible to set the Printer object before
you open the report, and then reset it to Nothing again afterwards. If you
want to do that, see:
Printer Selection Utility - Users assign printers to reports
at:
http://allenbrowne.com/AppPrintMgt.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
(Msg. 3) Posted: Tue Oct 27, 2009 7:20 am
Post subject: Re: Printer Choice [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Hello,
I have installed Allen Brownes Printer Selection Utility in Access 2003. So
far it works just fine except that when I print my report it only prints in
black and white and I would like it to always print in color. I have the
printer set to a PDF printer.
Any help?
"Allen Browne" wrote:
> "dave" <dave.TakeThisOut@accessdatapros.com> wrote in message
> news:2E110ACD-554E-436A-ABBF-7D64456FE626@microsoft.com...
> > Access 2007
> > I want to have a macro that prints a form to .pdf.
> > However the .pdf printer is not the default printer.
> > Is there anyway to code changing printers?
>
> This example assumes:
> - You have the PDF add-in installed. If not, see
> http://www.microsoft.com/downloads/details.aspx?familyid=4D951911-3E7E...E6-B059 > - You want to save the PDF to your desktop.
> - In older versions of Access, the code needs to just show a preview.
> - You need to apply a filter (i.e. print one invoice, not all of them.)
> - You want the pdf called "InvoiceXXX.pdf" where XXX is the invoice number.
>
> Dim strFile As String
> DoCmd.OpenReport "rptInvoice", acViewPreview, , "InvoiceID = " &
> Me.InvoiceID
> If Val(SysCmd(acSysCmdAccessVer)) >= 12# Then
> strFile = Environ("HOMEDRIVE") & Environ("HOMEPATH") & _
> "\Desktop\Invoice" & Me.InvoiceID & ".pdf"
> DoCmd.OutputTo acOutputReport, strDoc, acFormatPDF, strFile, True
> End If
>
> If that's not what you want, it is possible to set the Printer object before
> you open the report, and then reset it to Nothing again afterwards. If you
> want to do that, see:
> Printer Selection Utility - Users assign printers to reports
> at:
> http://allenbrowne.com/AppPrintMgt.html >
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html > Reply to group, rather than allenbrowne at mvps dot org.
>
>
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum