By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,813 Members | 2,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,813 IT Pros & Developers. It's quick & easy.

Closing a PDF file from VBA

P: n/a
I've written some code which opens a PDF file using :

"Application.FollowHyperlink strdbFilePath & strFileName, , True"

The user then types some information into the form and then clicks a
button which generates a new filepath for the file. Unfortunatly, if
the user doesn't close the PDF file, the whole thing grinds to a halt.
Just wondering if there is some code that I could put in the button to
close the pdf file when clicked??

Cheers

Reg

Aug 8 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Regnab wrote:
I've written some code which opens a PDF file using :

"Application.FollowHyperlink strdbFilePath & strFileName, , True"

The user then types some information into the form and then clicks a
button which generates a new filepath for the file. Unfortunatly, if
the user doesn't close the PDF file, the whole thing grinds to a halt.
Just wondering if there is some code that I could put in the button to
close the pdf file when clicked??

Cheers

Reg
Check out
http://www.mvps.org/access/api/api0007.htm
http://www.mvps.org/access/api/api0013.htm
http://www.mvps.org/access/api/api0025.htm

One of these should help.

With 13, and some mods on your part, you can get both class and caption.

I like http://www.mvps.org/access/api/api0018.htm to open up files
instead of FollowHyperLink. I can control the window state and I can
have the user dblclick instead of single click like a hyperlink part (I
separate the display text from the address and use the dblclick event).
Aug 8 '06 #2

P: n/a
Thanks Salad,

Works a treat. Might be pushing my luck a little now, but is it
possible to close the file rather than the application. What you've
pointed me to works great and will do what I need.... but in the ever
growing desire to make one's databases a little more effecient, is it
possible to close just the file (as I think this would make subsequent
pdf file opening quicker if adobe is already running).

The other thing you mentioned that I was curious about is it allows you
to control the window state. What does that mean?

Thanks for all your help

Cheers

Reg

Aug 8 '06 #3

P: n/a
Regnab wrote:
Thanks Salad,

Works a treat. Might be pushing my luck a little now, but is it
possible to close the file rather than the application. What you've
pointed me to works great and will do what I need.... but in the ever
growing desire to make one's databases a little more effecient, is it
possible to close just the file (as I think this would make subsequent
pdf file opening quicker if adobe is already running).
You might want to google around...see
http://groups.google.com/advanced_search
and enter
*Access*
in the groups texbox and something like
Adobe automation
in the search for.

If Adobe allows automation, you'll probably find some code to do a
file/close or file/save

The other thing you mentioned that I was curious about is it allows you
to control the window state. What does that mean?
Min, Max, etc.
>
Thanks for all your help

Cheers

Reg
Aug 9 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.