Automation

P

paradigm

I am creating an Access 2003 program that requires to view a pdf file. The
program opens the pdf file for viewing using Adobe Reader. I then need to
close the Adobe Reader when an option is selected in my program. How can I
get Access to close another program. If the user already has reader open
viewing another pdf file then I need to be able to close only the reader
viewing my file.
Alex
 
T

Tony Toews [MVP]

paradigm said:
I am creating an Access 2003 program that requires to view a pdf file. The
program opens the pdf file for viewing using Adobe Reader. I then need to
close the Adobe Reader when an option is selected in my program. How can I
get Access to close another program. If the user already has reader open
viewing another pdf file then I need to be able to close only the reader
viewing my file.

You can possible determine which instance of Adobe Reader is viewing
the file mentioned by using the following code adapted for your needs.

API: Preventing multiple instances of a database
http://www.mvps.org/access/api/api0041.htm
ACC2000: How to Determine If Specific Windows Program Is Running
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q210605

Do note that if you change the title of your Access MDB in the Startup
options that's the title you must look for.

This looks like it will return the "handle" to the appropriate
application. Now here's an article that looks like it will do what
you want.

http://articles.techrepublic.com.com/5100-22-1050075.html

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/
 
P

paradigm

The code from Techrepublic does exactly what I need because I can identify
the name of the document that is open in Adobe Reader.
Thank you.
Alex
 

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