Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching Adobe from Access

Status
Not open for further replies.

Kicker

Technical User
Oct 15, 2000
14
0
0
US
I use a db that has a number of PDF files stored as OLE. I can launch the Adobe Reader by double clicking on the control in form view, but would like to be able to launch using VB. I can get Adobe to launch using the "Shell" command, but have not been able to specify which PDf I want to display. Does anyone know how to specify a specific recordset when launching Adobe from the Shell.

Shell("C:\Program Files\Adobe\Acrobat 4.0\Acrobat\Acrobat.exe ")

will launch a blank view in Adobe

Dim olePDFt As Object
Set olePDFt = Me.PDF
Shell ("C:\Program Files\Adobe\Acrobat 4.0\Acrobat\Acrobat.exe olePDF")

Does not work.
Thanks for help
 
i havent tried it with acrobat, but with many other programs, your idea is correct. However, you need to concatenate the Olelink into the Shell string, rather than entering OldPDF into the shell string.
i.e.
Dim strPDF as String
Shell ("C:\Program Files\Adobe\Acrobat 4.0\Acrobat\Acrobat.exe " & strPDF)

Assuming the Ole object contains a path to the file as well as the name (which is how I would always choose to store such objects), it should run a shell, with acrobat, & open it with the opening argument at the end (strPDF).

James Goodman
 
Thanks for the idea, unfortunately it did not seem to work. Still got a "could not find file" error.

If I give the shell the directory path the a separate PDF file, F:\Temp\Test.PDF, the program launches and displays the PDF just fine. If I use a double click or VBA oleActivate commands, Adobe also launches and displays.

Is there a function or switch that I can use to simulate the oleActivate command, but without having to actually instantiate the form on which the OLE is located.

Thanks for any ideas.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top