Skip to content

Instantly share code, notes, and snippets.

@gioxx
Created October 16, 2020 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gioxx/8dfa0529288b2c871eda737470f3cbdd to your computer and use it in GitHub Desktop.
Save gioxx/8dfa0529288b2c871eda737470f3cbdd to your computer and use it in GitHub Desktop.
Una macro per scovare in quale cartella si trova un'email.
' Outlook 2016: Find Email Position
' -----------------------------------------------------------------------------------------------------------
' Author: Michael Bauer
' Modified by: GSolone
' Version: 0.1
' Last modified: 14-10-2020
' Credits: http://vboffice.net/en/developers/get-the-message-folder/
' ------------------------------------------------------------------------------------------------------------
' UPDATES:
' -
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 = "L'email si trova in: " & F.FolderPath & vbCrLf
Msg = Msg & "Ti porto alla cartella?"
If MsgBox(Msg, vbYesNo) = vbYes Then
Set Application.ActiveExplorer.CurrentFolder = F
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment