control Windows dialog box from database form

R

Rondy

Hi Experts and fellow programmers!

Working with A2K, here's the situation: I have a function that creates a
PDF from a form (changes user's default printer to PDFWriter--prints--returns
default printer to normal), and part of that procedure is that the user must
save the PDF file.

I need to either A) control where they store the PDF by forcing a path
during Save As..., or B) capture the path to where they stored it on their
own.

Either option is fine, if you can please help me figure out how!

Thanks in advance for any help,
Rondy
 
D

Dirk Goldgar

Rondy said:
Hi Experts and fellow programmers!

Working with A2K, here's the situation: I have a function that creates a
PDF from a form (changes user's default printer to
PDFWriter--prints--returns
default printer to normal), and part of that procedure is that the user
must
save the PDF file.

I need to either A) control where they store the PDF by forcing a path
during Save As..., or B) capture the path to where they stored it on their
own.

Either option is fine, if you can please help me figure out how!


Does PDFWriter let you specify the filename programmatically? If not, you
can use Stephen Lebans's ReportToPDF solution, posted here:

http://www.lebans.com/reporttopdf.htm

instead.
 
R

Rondy

Dale,

That API article shows how to call the File Open or Save window, but the one
I have to work with is called automatically when printing to PDF so I am
forced to work with that instead of calling my own.

Am I missing something in that code that could be used to simply capture the
path and file name when user saves the PDF, when I didn't programmatically
call the Open/Save window myself?

Rondy
 
P

Paul Shapiro

I don't think there's any straightforward way to capture another
application's dialog box. I've always handled this kind of thing by opening
my own dialog box to let the user choose the path and file name, and then
using that to create the file.

I have a class module that automates this process for creating PDF's, if
you're using Acrobat. My code doesn't use the pdf printer, but sets
temporary registry values from which Acrobat reads the output path and
filename. Email me if you want a copy. You might be able to set the pdf
printer's output destination instead though.
 
T

Tony Toews [MVP]

Paul Shapiro said:
I have a class module that automates this process for creating PDF's, if
you're using Acrobat. My code doesn't use the pdf printer, but sets
temporary registry values from which Acrobat reads the output path and
filename. Email me if you want a copy. You might be able to set the pdf
printer's output destination instead though.

I can't recall if we've ever discussed this topic before. But if you
like I'd be happy to create a web page with the details of you how do
this including a sample MDB on my website. With full credit to you of
course.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Rondy

Paul,

We do indeed use Acrobat, so I will email you shortly for that class module.
Sounds like that may also help with another problem I was having
automatically naming the files...

Thank you so much!
Rondy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top