Solved

MS Access 2003 VBA Global Module Acrobat File Path Variable

Posted on 2013-05-15
2
616 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now