Solved

MS Access 2003 VBA Global Module Acrobat File Path Variable

Posted on 2013-05-15
2
618 Views
Last Modified: 2013-05-15
Inherited an MS Access ADP App.

In a Global Module the path to Acrobat is found.

Problem is that all this is hard coded.

Originally all machines were WinXP SP3 and programs were installed on a D drive partition.

Now we're moving to Win 7 and some, but not all, have varying Acrobat paths.
Along with the 50 or 60 PC's that are still on XP

The VBA below has several paths...
I'd like one way to set this.

And I want the Acrobat variable to stay the same
Public Const Acrobat = "C:\Program Files\Adobe\Acrobat 11.0\Acrobat\Acrobat.exe /n /o"
'Public Const Acrobat = "C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe /n /o"
'Public Const Acrobat = "C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Acrobat.exe /n /o"

Open in new window

0
Comment
Question by:lrbrister
2 Comments
 
LVL 3

Accepted Solution

by:
pjevin earned 500 total points
ID: 39168517
You could use Dir to see if the file exists in that location, if it doesn't it will just return nothing.

if (len(Dir("C:\Program Files\Adobe\Acrobat 11.0\Acrobat\Acrobat.exe")>0) then
Acrobat = "C:\Program Files\Adobe\Acrobat 11.0\Acrobat\Acrobat.exe /n /o"
else etc...

I doubt you want to go through the trouble of finding it.
0
 

Author Closing Comment

by:lrbrister
ID: 39168949
Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question