| | Awarded by Microsoft since 2005: |  |
| | VBOffice Info | | Visitors | 1408211 | | Impressions | 5182300 |
| |
|
| |
| Author: Michael Bauer | Homepage | | Date: 08.06.2008 | Accessed: 29608 | | | | Description
If you search in multiple folders for an e-mail, Outlook can tell you the name of the folder the e-mail has been found in. But if you have multiple folders with the same name, this information is quite useless.
This sample demonstrates how to get the folder's path. Additionally, it offers to switch to the folder.
If you used the direct search, you can select one e-mail of the result in the folder and call the macro; if you used the advanced search, it's necessary to open the e-mail and then call the macro.
As always, copy the code into the module "ThisOutlookSession". You can either call it by pressing ALT+F8, or customize the toolbar and drag the macro on it. |
Public Sub GetItemsFolderPath()
Dim obj As Object
Dim F As Outlook.MAPIFolder
Dim Msg$
Set obj = Application.ActiveWindow
If TypeOf obj Is Outlook.Inspector Then
Set obj = obj.CurrentItem
Else
Set obj = obj.Selection(1)
End If
Set F = obj.Parent
Msg = "The path is: " & F.FolderPath & vbCrLf
Msg = Msg & "Switch to the folder?"
If MsgBox(Msg, vbYesNo) = vbYes Then
Set Application.ActiveExplorer.CurrentFolder = F
End If
End Sub
|
| | |
| | |  | ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the ... [more] |
| | |  | Access the master category list in the blink of an eye, share your categories in a network, get a reminder service, and ... [more] |
| | |  | SAM automatically sets the sender, signature, and folder for sent items, for instance based on the recipient ... [more] |
| | |  | OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or ... [more] |
| |
|