Prev: auto populate time 'time out' field when user comes into a record the second time.
Next: Defaulting Values for a one-to-many Form
From: Albert D. Kallal on 29 Jun 2010 19:16 "Arno R" <arracomn_o_s_p_a_m(a)planet.nl> wrote in message news:4c29e9ad$0$14124$703f8584(a)textnews.kpn.nl... > Hi all, > > I need to print to (or publish) an Access report to pdf with code. > This is a standard option with Access 2007 (SP2) > > BUT....I don't want to use the option on the ribbon for this. > I need/want to code this. > > Any ideas? > Thanks, Arno R > I have a download sample here: In the above, I have a PDF button on the ribbon, and ALSO even a email as PDF button on the ribbon. Albert D. Kallal (Access MVP) Edmonton, Alberta Canada NoSpam_kallal(a)msn.com
From: Albert D. Kallal on 29 Jun 2010 19:16 sorry, link here: http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm
From: Arno R on 30 Jun 2010 13:07 Hi Albert, Thanks for the link, but I was NOT looking for an option on the ribbon... I needed the standard functionality to 'print as PDF' on a custom toolbar. This is meant for 2003 apps used by the Access2007 Runtime where I do NOT want to show the ribbon. However the XML code maybe useful. Regards, ArnoR "Albert D. Kallal" <PleaseNOOOsPAMmkallal(a)msn.com> schreef in bericht news:h9vWn.5780$3%3.3668(a)newsfe23.iad... > sorry, link here: > > http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm > >
From: Albert D. Kallal on 1 Jul 2010 03:23 "Arno R" <arracomn_o_s_p_a_m(a)planet.nl> wrote in message news:4c2b79df$0$14122$703f8584(a)textnews.kpn.nl... > Hi Albert, > > Thanks for the link, but I was NOT looking for an option on the ribbon... > I needed the standard functionality to 'print as PDF' on a custom toolbar. > This is meant for 2003 apps used by the Access2007 Runtime where I do NOT > want to show the ribbon. > Ok, first keep in mind that office 2007 and 2010 don't "print" as pdf. The feature is native, and thus you save your document as a PDF. It only those PDF printers you install that work that way, not applications that have pdf support built in like office. So, just have your menu bar button call some VBA code to save the report as PDF. So, in a standard code module, you can place: Public Function SaveAsPDF() DoCmd.OutputTo acOutputReport, Screen.ActiveReport.name, acFormatPDF End Function so, then on your menu bar button, just set the on action to the above eg: =SaveAsPdf() So, it only one line of code in a module, and your menu bar button code can then call the above VBA code as per above. If you not talking about a custom menu bar button, then just call the code behind a button like: SaveAsPDF Albert D. Kallal (Access MVP) Edmonton, Alberta Canada kallal(a)msn.com
From: Arno R on 1 Jul 2010 04:37
Thanks again Albert, I allready figured this out. FYI: I also needed to change the (unknown to Access2003) constant acFormatPDF to "PDF Format (*.pdf)" since Access 2003 would not compile anymore... Arno R "Albert D. Kallal" <PleaseNOOOsPAMmkallal(a)msn.com> schreef in bericht news:5nXWn.4147$oN4.2379(a)newsfe04.iad... > "Arno R" <arracomn_o_s_p_a_m(a)planet.nl> wrote in message news:4c2b79df$0$14122$703f8584(a)textnews.kpn.nl... >> Hi Albert, >> >> Thanks for the link, but I was NOT looking for an option on the ribbon... >> I needed the standard functionality to 'print as PDF' on a custom toolbar. >> This is meant for 2003 apps used by the Access2007 Runtime where I do NOT want to show the ribbon. >> > > Ok, first keep in mind that office 2007 and 2010 don't "print" as pdf. The feature is native, and thus you save your document as a > PDF. It only those PDF printers you install that work that way, not applications that have pdf support built in like office. > > So, just have your menu bar button call some VBA code to save the report as PDF. > > So, in a standard code module, you can place: > > Public Function SaveAsPDF() > > DoCmd.OutputTo acOutputReport, Screen.ActiveReport.name, acFormatPDF > > > End Function > > so, then on your menu bar button, just set the on action to the above > > eg: > > =SaveAsPdf() > > So, it only one line of code in a module, and your menu bar button code can then call the above VBA code as per above. If you not > talking about a custom menu bar button, then just call the code behind a button like: > > SaveAsPDF > > > > Albert D. Kallal (Access MVP) > Edmonton, Alberta Canada > kallal(a)msn.com > > > |