# Issues with File Associations in Access 2003/2010 and Windows XP/7

OK, I think this is an interesing situation.

I have changed the program association for PDF files in Windows from Adobe reader to a PDF editor that we purchased.  From Windows Explorer (in XP and/or 7) I can double click a PDF file and it will open in the editor which is correct based on my file associations.

In Access (2003 and/or 2010) I have a couple of image buttons and links that I set the path (HyperlinkAddress) and file name to the appropriate PDF file if it exists.  When I click on the links, the Adobe Reader opens, not the editor.

I am not specifying (in Access) what program to use to open the file yet it is using a program that is no longer associated with the extension.  I should be able to use the associations since some users will be using the Adobe Reader and some the new Editor.

Microsoft AccessWindows XPWindows 7

Last Comment
Michael Kacos

8/22/2022 - Mon
ded9

If u have purchased foxit editor then install foxitreader..no changes are required.

Ded9
johnb6767

File Associations are stored for the machine, and per user.....

Does this affect all users?
Michael Kacos

Johnb6767

I agree that file associations are stored on teh machine and for the user.  I have had this happen on two different machines under two different users.  It is a really weird situation.  FYI: I have closed and reopend the app, rebooted, powered of, etc.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Jeffrey Coachman

Yet another reason NOT to use hyperlinks...

Instead store the full file path and name to the file in a simple text field.

Then you can "Force" the PDF to open with any app you like with code similar to this:

Dim varApp as variant
varApp =Shell("C:\Program Files\YourPDFEditor\YourPDFEditor.exe " & me.FullFilePath,vbnormalfocus)

You can use something like this to browse to, and insert the full filename and path:

johnb6767

HKEY_CLASSES_ROOT\AcroExch.Document

and a similar value under here...

HKEY_CURRENT_USER\Software\Classes. Either a .PDF/AcroExch.Document subkey....

(sorry, don't have a secondary PDF viewer installed to validate this above key)

Maybe even here.....

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf

Both under HKCU can be safely deleted, and the System Default will take over.....

Michael Kacos

Johnb6767

I did find HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithList that still listed Adobe as the viewer.  I changed that to the desired program.  I also changed [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pdf\OpenWithList\AcroRd32.exe] to the correct program, rebooted, and got the same results.

Just to add fuel to the fire, I opened a PDF attached to an e-mail (in both versions of outlook and windows) and it used the editor to open it.

I searched the registry keys and data for .pdf, Acrord32, and CutePDF (the program I am trying to use) and I did not see anything obvious.  FYI: This is how I found the OpenWithList key above.

Get an unlimited membership to EE for less than $4 a week. Unlimited question asking, solutions, articles and more. johnb6767 Anything under "HKEY_LOCAL_MACHINE\SOFTWARE\Classes" regarding "Acro"? The OpenWithLists shouldn't have any bearing on EXACTLY what forces it to open, just populates the menus when you select "Open With"..... Have you removed Adobe Reader, and then re associated .PDFs to the Purchased Editor? That would definitely isolate it to a File Association/Access Issue..... Michael Kacos ASKER Nothing for just Acro but there are dozens that start with "Acro" and even more that start with Adobe. The keys I included below look interesting but I am a little nervous about just jumping in and trying it. Are we getting closer? Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\acrobat] "URL Protocol"="" @="URL:Acrobat Protocol" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\acrobat\DefaultIcon] @="C:\\Program Files\\Adobe\\Reader 9.0\\Acrobat\\AcroRd32.exe" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\acrobat\shell] [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\acrobat\shell\open] [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\acrobat\shell\open\command] @="\"C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRd32.exe\" /u \"%1\"" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\acrobat\shell\open\ddeexec] @="[HandleAcroURL(\"%1\")]" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\acrobat\shell\open\ddeexec\application] @="Acroview" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\acrobat\shell\open\ddeexec\topic] @="Control" Jeffrey Coachman mkacos, You seemed to have ignored my post... https://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_27251613.html?cid=1572#a36353250 It is simply a courtesy to comment on all expert posts in chronological order... This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors. rwheeler23 Michael Kacos ASKER Boag2000 - Sorry for ignoring your post. Your recomendation would mean the program would have to know what was installed on each computer to work vs. using the operating system. I would prefer to resolve the problem differently than you recommended. Jeffrey Coachman ok johnb6767 That key is the same as HKCR. Thats how HKCR gets populaed,. from HKLM\Software\Classes..... I dont think that key has any bearing on this..... Its not the default for .PDF files. You would have to see what it is under HKCR\.PDF The default value will tell you where to look..... Get an unlimited membership to EE for less than$4 a week.
Unlimited question asking, solutions, articles and more.
Michael Kacos

John - Everyting I find under HKCR shows the correct program.
johnb6767

"Have you removed Adobe Reader, and then re associated .PDFs to the Purchased Editor? That would definitely isolate it to a File Association/Access Issue..... "
Michael Kacos

John

Well, unfortunatly, the editor I purchased requies Adobe Reader to be installed.  I tried it and of course it failed.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
johnb6767

Im no access guru by any means (bout all I can do with access is spell it.... Most of the time...)

"I am not specifying (in Access) what program to use to open the file yet it is using a program that is no longer associated with the extension"

Basically it is calling an open statement with a file based on the extension?

Process Monitor might come in handy to see what reg keys it is querying when you do this.....

http://live.sysinternals.com/procmon.exe

Set the filter at the top to msaccess.exe (or your front end .exe name), and clear the filter at the top (hover over the icons for their functions) right before you make the call to the .PDF. Then once it opens in the wrong app, stop the logging. In the output, you can right click a path/process/result, and either include ONLY that, or exclude it from view to make it easier to dig through. It is a bit cumbersome, but is great information once you learn the filters.........
Michael Kacos

John

Makiing progress.  I found where it found "HKCR\CLSID\{B801CA65-A1FC-11D0-85AD-444553540000}" which looks like the definition of a Adobe Acrobat Document.  Under this key there is a "localserver32" key which contains the path to the Adobe PDF reader.  I changed this value to the editor and it sort of worked.

There seems to be more values that need to be changed.  The program will eventually open the document but it is taking several minutes to accomplish.  I am going to look a little deeper, there are several keys under the original one such as ProgID, DefaultIcon, Verb, ec, etc, etc.  Actually there are 15 more keys plus a few with branches.

Any insight would be greatly appreciated.
Michael Kacos

I have found a little more information but I do not have a solution as of yet.  It seems there is another "file association" that I cannot find how to change except through regedit.  I have found the definition of AcroExch.Document and AcroExch.Document.7 in the registry.  I can change the values of the data associated with these keys (HKEY_CLASSES_ROOT\AcroExch.Document.7\shell\Open\command ) to the program I want but it takes it over a minute to open the doc.

How do I change this association within Windows so I can make sure it gets changed correctly?  It is NOT the file extension association in the control panel because this has already been changed.  FYI: The file extension association in folder options in the control panel works fine EXCEPT in Access.  If I open a PDF attachment in any other program I get the expected results.

Get an unlimited membership to EE for less than \$4 a week.
Unlimited question asking, solutions, articles and more.
Michael Kacos