Customise Access icon in Windows 7 taskbar

Hi Sami,
Please test to see if your method also works if you set your Taskbar property to "Always combine, Hide labels".
Thanks
Pierre
 
Yes of course, that's what I was looking for : allows any MS Access RT to show custom icon for my 2K application with W7 taskbar property set to "Always combine, Hide labels" which is the default option for millions people.

Pierre : are you french ??? It seems also that you have a high level in Access and you prefer to stay in MS Access 2000 or 2003 like me, isn't it ?
 
Hi Sami, yes I'm a die-hard 2003 fan. I charge extra to develop in 2007 or 2010 :)

I'm a "Lover not a Fighter" but not French. I'm from South Africa.

I'm tried your way (I actually had the shortcut setup that way with a custom icon as well as a custom icon path in Access' Startup Options) but I still get the Original Access Icon in the taskbar when I choose to "Always combine, Hide labels".
So either I'm missing something or you need to explain in details.

Thanks again
Pierre
 
Or did I misunderstand and you, in some way, declared the shortcut path as part of the target command line instead of via the "Change Icon" button?

If so, please paste your target line here please

Thanks
Pierre
 
OK,

Try with MS Access path as prefixal of the command line in the target of shortcut. For example :

"C:\Program Files (x86)\Microsoft Office 2003\OFFICE11\MSACCESS.EXE" /wrkgrp "C:\Program Files\ProGest.demo\_Reseau\Data\ProGest.mdw" /user "sami" /pwd "****" "C:\Users\Sbenelhadj\AppData\Roaming\ProGest.demo\GestDoc.mde"

Change the icon of the shortcut with your custom icon and still define it as the application icon in the startup menu of your DB (to see it in the W7 taskbar sub Window).

This works fine for me and I have my custom icon in a specific group in the W7 taskbar. I swear it to you :D

Tomorrow afternoon, I'll test it on another PC with W7 (now, it's too late in France and I'm hungry ;)).

Bye.
 
Hi there, hope you got something to eat in time:)
I tried it like you said (had it much the same). But not showing my custom icon.
Please try on the other machine running W7 and let me know.

Else look me up on Skype: UncleBase

Regards
Pierre
 
OK : I've tried on another W7 machine and it works fine !

I've put an example that you can download here :
h t t p : / / c d - c o n c e p t . c o m / p r o / d l / c d c / b d 1 . z i p
(the url is parsed to allow me to post it ;))

You just have to unzip all files in C:\ without subfolder and change the path of the two shortcuts to adapt them to your own MSACCESS.EXE path.

Note that I was wrong when I said that you can make a shortcut with the database path only : in fact, you have also to specify explicitly MS Access path in the shortcut. It's not a problem for me because it's easy to automatically create a temporay shortcut from vbs or vba to launch my applications.

Bye.
 
Ahhh - briliant - I can report back that you are quite correct in stating that the trick was to include the path to MSAccess.exe along with the path to your application.

In that way it does in fact display the custom icon.

Such a small thing but it works.

Thanks a lot for that old friend!!

Cheers
Pierre
 
Well did it work?

Hi
Is this supposed to work with Win 7 and Access 2010

:banghead:

In answer to my own question, yes it does...

Although, it didn't work until I closed on reopened access.

Thanks for code Nigel
 
Last edited:
Hi guys,

Sorry to resurrect an old thread but this looks really interesting!

Question to SamiFrance (or anyone else who can answer)

I use a shortcut to launch my DB but it doesn't point directly to the DB; rather it points to a .vbs script on the network which copies the FE over to the users local machine and then launches that.

The reasons for this are twofold - first, my FE makes use of temporary local tables to speed up some of the more complex queries. By taking a fresh copy of the FE on each launch, I remove the need to compact & repair the FE each time. Second, I can easily release a new version by just replacing the master copy on the network; when the users click their shortcut, the new version is automatically copied over.

So my question is this - how can I adapt my .vbs script so that I too can get my custom icon in the taskbar in its own distinct group from other Access DB's?

I use Shell in the last line of the script to launch the newly copied local FE :

Code:
Set objShell = WScript.CreateObject("WScript.Shell")
 
objShell.Run """" & strLocalFilePath & strLocalFileName & """", 3, False

I'm thinking I need to get the path to the local msaccess.exe executable in there but a) not sure where or how and b) would prefer to try to detect its location rather than hardcode it as "C:\Program Files\" etc.

Any assistance would be hugely appreciated as I'd really love to make my custom icon visible in the taskbar!!!

Thanks

Al
 
Okay here's where I'm at - this works but doesn't take the custom icon in the same way that using a direct shortcut to the .accde would (and including the path to the MSACCESS executable in the command line)

Any suggestions?

Code:
strRegKey = "HKEY_LOCAL_MACHINE\" & _
            "SOFTWARE\Microsoft\Windows\" & _
            "CurrentVersion\App Paths\MSACCESS.EXE\Path"
 
Set objShell = WScript.CreateObject("WScript.Shell")
 
strMSAccessExePath = objShell.RegRead(strRegKey) & "MSACCESS.EXE"
 
objShell.Run Chr(34) & strMSAccessExePath & Chr(34) & " " & _
             Chr(34) & strLocalFilePath & strLocalFileName & Chr(34), 3, False
 
You should be asking the "creating a shortcut" question in an appropriate VBScript forum, you'll get more help there. Here's a link on creating shortcuts using VBS:

http://www.giannistsakiris.com/2008/12/03/how-to-create-shortcuts-in-windows-from-the-command-line/

The Target should be "Path to msaccess.exe" "Path to mdb". If you're installing on a network I would imagine the path to msaccess.exe should be consistent. And as long as you've already set the Application.icon before packaging it should show in the taskbar in its own group.

You may need some code to point the Application Icon property to the new path where the icon will be located.
 
Okay, figured it out! Not exactly elegant but it works!

My method is to create a new shortcut in the .vbs script (on the local machine) which points directly to the newly copied FE and assigns the icon, then runs that

So basically, my shortcut creates and runs another shortcut, which has the attributes described by SamiFrance and therefore retains the custom icon in the taskbar.

Script below should anyone else launch their DB's in the same way...

Code:
strRegKey = "HKEY_LOCAL_MACHINE\" & _
            "SOFTWARE\Microsoft\Windows\" & _
            "CurrentVersion\App Paths\MSACCESS.EXE\Path"
 
Set objShell = WScript.CreateObject("WScript.Shell")
 
With objShell
 
    strMSAccessExePath = .RegRead(strRegKey) & "MSACCESS.EXE"
 
    Set lnkLocal = .CreateShortcut(strLocalFilePath & "\MyShortcut.lnk")
 
    With lnkLocal
        .TargetPath = strMSAccessExePath
        .Arguments = strLocalFilePath & strLocalFileName
        .IconLocation = strNetworkFilePath & "MyCustomIcon.ico"
        .WorkingDirectory = strLocalFilePath
        .Save
    End With
 
    .Run strLocalFilePath & "\MyShortcut.lnk", 3, False
 
End With
 
Set lnkLocal = Nothing
Set objShell = Nothing
 
Thanks vbaInet (again) - we posted simultaneously but looks like I did what you suggested?...
 
Yes pretty much. My final point about the icon is the icon for the db itself, not the shortcut. Because it's a path and not an icon saved in the db, you'll need to point it to the path correct path after installation.
 
The icon for the db itself is embedded in the FE already - the only problem was that, in the taskbar, the default Access icon appears in its place. SamiFrance's solution was to use the same icon in the shortcut, splitting the target path into application and file, which results in the icon showing in the taskbar as well. No?
 
Yes the taskbar icon gets saved but if you ticked "Use as Form and Report icon" then it needs to point to the ico file for it to show within the application itself (i.e. top left hand side of the application or top LHS of the form).
 
Oh, okay, yeah I've already done that too
 
An alternative to the registry key check is the Where command in shell.

By the way, is it really necessary to re-create the front end every single time? You can schedule a task to do it every week or even do a compact on close every week.
 
Not familiar with the Where command in Shell; is that a 'better' way of identifying the executable?

Recreating the FE each time isn't essential, but it's a very simple way to ensure the users are using an up-to-date, compact version with no hangovers from previous use (just in case anybody accidentally / mischievously meddles with it - although highly unlikely given it's an .accde, though)

No C&R required and the overwrite is extremely quick to perform. Completely unnoticeable to the end user, while a C&R or scheduled overwrite may not necessarily be.

I don't really see the problem with it?
 

Users who are viewing this thread

Back
Top Bottom