Solved

MS Access 2003 VBA Global Module Acrobat File Path Variable

Posted on 2013-05-15
2
621 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

717 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