| Member with 360 posts. THREAD STARTER | | Join Date: Feb 2006 Location: Wellingborough, UK Experience: I have no idea what I don't know - how could I? | |
Access 2003 - Correct Use of VBA "Shell" command In my VBA script, I have a section associated with an onclick event in my Access form. Onclick, I want to run Adobe Acrobat and open a specific PDF file.
Now I have this code (paths for 'Filename' is an example) Dim RetVal
Dim Filename As String
Filename = "C:\ManualRevA.pdf"
RetVal = Shell("C:\Program Files\Adobe\Adobe Acrobat 6.0\Acrobat\acrobat.exe " & Filename, 1)
This is ok for the filename as I'll be using InstallShield to fix the location of the PDF. The problem arises with the path for Acrobat itself. If the client is running version 6 or 7, the text for the path is different.
I saw a reference to on a different website to the start command (which works at the DOS level) Shell "start C:\ManualRevA.pdf"
This would allow the VBA to call up the PDF without the acrobat.exe element, it uses the file type to determine the correct application.
Trouble is I can't figure the syntax for the "Shell start... " command so its not working for me and I'd like it to!
Can anyone help?
Thx in advance
Chris |