dbTalk Databases Forums  

Choose filename and folder when saving report to PDF

comp.databases.ms-access comp.databases.ms-access


Discuss Choose filename and folder when saving report to PDF in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sietske
 
Posts: n/a

Default Choose filename and folder when saving report to PDF - 01-21-2008 , 04:56 AM






Dear all,


My form contains a button to save a report to PDF. However, the future
user can not choose the place the pdf is placed, nor the name of the
pdf: this is all automatically generated; I assume this is done by the
pdf-printer.

Is there a way to make it possible that the place and/or the name of
the pdf can be chosen by the user?

I was thinking of using fHandleFile or acSysCmd, but I definitely
could use some hints to help me on the way somewhat more.


Best regards,
Sietske

************************************************** ****************************
My current code (with help of accarch131.zip on http://www.helenfeddema.com/access.htm)
looks like this:

'Remember the standard printer
Set prt = Application.Printer
Debug.Print "Current default printer: " & prt.DeviceName

'Make the PDF-printer temporary the standard printer
Application.Printer = Printers("PDFCreator")

'Print the report to the PDF-printer
Dim strDocName As String
Dim strWhere As String
strDocName = "rptConsult"
strWhere = "[Id_Consult]=" & Me!Id_Consult
DoCmd.OpenReport strDocName, acViewNormal, , strWhere

'Make the original printer standard again
Application.Printer = prt

************************************************** ****************************

Reply With Quote
  #2  
Old   
Allen Browne
 
Posts: n/a

Default Re: Choose filename and folder when saving report to PDF - 01-21-2008 , 06:09 AM






See:
Call Windows Browse for Folder Dialog box
at:
http://www.mvps.org/access/api/index.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.

"Sietske" <sietske.hoekstra (AT) gmail (DOT) com> wrote

Quote:
Dear all,


My form contains a button to save a report to PDF. However, the future
user can not choose the place the pdf is placed, nor the name of the
pdf: this is all automatically generated; I assume this is done by the
pdf-printer.

Is there a way to make it possible that the place and/or the name of
the pdf can be chosen by the user?

I was thinking of using fHandleFile or acSysCmd, but I definitely
could use some hints to help me on the way somewhat more.


Best regards,
Sietske

************************************************** ****************************
My current code (with help of accarch131.zip on
http://www.helenfeddema.com/access.htm)
looks like this:

'Remember the standard printer
Set prt = Application.Printer
Debug.Print "Current default printer: " & prt.DeviceName

'Make the PDF-printer temporary the standard printer
Application.Printer = Printers("PDFCreator")

'Print the report to the PDF-printer
Dim strDocName As String
Dim strWhere As String
strDocName = "rptConsult"
strWhere = "[Id_Consult]=" & Me!Id_Consult
DoCmd.OpenReport strDocName, acViewNormal, , strWhere

'Make the original printer standard again
Application.Printer = prt

************************************************** ****************************


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.