An Outlook user had a question:
I have mail sorted into folders in a separate data file. There is one folder that I need to be able to access quickly. Is there was a way to create a link or a shortcut to that folder on my desktop? I researched this, but it all seemed overly complicated and referred to older versions. Is there is a simple solution?
Older versions supported created links to folders on the Windows desktop, however, Microsoft removed this option about 20 years ago. You have a couple of options within Outlook though:
- Add the most used folders to the Mail Favorites in Outlook. If you aren't showing the Favorites list, enable it from the View tab > Folder Pane button. Then right-click on a folder and choose Add to Favorites to add it. To remove a folder from Favorites, right-click the folder and choose Remove from Favorites. (You can drag and drop too.)
- Use VBA to open the folder and add buttons to the ribbon (or QAT) to run the VBA. If you have several folders you want to open, you can create a custom ribbon for the buttons.
If you really want a shortcut on the desktop, you can use PowerShell or VBScript to open the folder. Save the .ps1 script to a folder and add a shortcut to the desktop.
The advantage of either PowerShell or VBScript over VBA is that you do not need to change macro security settings.
PowerShell to Open an Outlook Folder
This PowerShell opens a sub folder of the Inbox. When Outlook is open, the only con is that a black PowerShell screen flashes momentarily when you run it. (It will open Outlook if it is closed.)
To use, paste into Notepad, change the datafile display name and folder name then save with .ps1 extension to your desktop. Right-click on the script and choose Run with PowerShell. If you want to open the PowerShell file with a double click, create a windows shortcut (the steps are after the PowerShell script samples)
$olApp = new-object -comobject outlook.Application $namespace = $olApp.GetNamespace("MAPI") #Folder is in another datafile, at the same level as Inbox. $currentExplorer = $namespace.Folders.Item("Data File Display Name").Folders.Item("Keep") $currentExplorer.Display() $olApp.Quit | Out-Null [GC]::Collect()
Use this format if the folder is in the default data file, at the same level as the Inbox.
$currentExplorer = $namespace.GetDefaultFolder(6).Parent.Folders("Keep")
Use this if the folder is a subfolder of the Inbox
$currentExplorer = $namespace.GetDefaultFolder(6).Folders("Test")
Create a shortcut to run the script
- Right-click on the ps1 file and create a shortcut to it.
- Right-click on the shortcut and choose Properties.
- In the Targe field, add powershell.exe -F in from to the file path and put quotes around the file path.
- The Target should look like this if you look at the Properties after saving it:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -F "C:\path\to\script\name.ps1"
- Apply and close the shortcut.
- Move the shortcut to the desktop.
VBScript to Open an Outlook Folder
If you prefer to use VBScript, paste this code into Notepad, change the datafile display name and folder name then save with .vbs extension.
Set oOutlook = GetObject("","Outlook.Application") Set oName = oOutlook.GetNamespace("MAPI") Set oFolder = oName.Folders.Item("Data File Name").Folders.Item("Keep") oFolder.Display
As with PowerShell, use this format if the folder is in the default data file, at the same level as the Inbox.
Set oFolder = oOutlook.GetDefaultFolder(6).Parent.Folders("Keeps")
Double click to run the VBS file or shortcut to the VBS file.
Thnnnxxx.
Best best best..