Outlook 365 Jump to folder

Victor_50

Member
Outlook version
Outlook 2013 32 bit
Email Account
POP3
Operating system::    W11 pro
Outlook version:     Classic Outlook
Email type or host:    POP

For a long time I wanted a way to jump to the folder an email is in. From "Favorites" or from the folder specified in a searchfolder. I recently found VBA code, that worked up to a certain point. But instead of jumping to the folder it jumped to "Notes" in the sidebar. Apparently MS changed something. I wanted to fix this by first jumping to some folder (Inbox) if necessary and then jumping to the real folder. It turns out MS has made referencing folders in Outlook so complex, I couldn't fix this, especially while the new "help" in "learn" really can't learn me anything. My unfinished code:

Code:
Public Sub GetItemsFolderPath()
  
  Dim obj As Object
  Dim Vname As Outlook.NameSpace
  Dim Vmapi As Outlook.MAPIFolder
  Dim Vfolder1 As String
  Dim Msg$
  Set obj = Application.ActiveWindow
  Set Vname = Application.GetNamespace("MAPI")
    
  If TypeOf obj Is Outlook.Inspector Then
    Set obj = obj.CurrentItem
  Else
    Set obj = obj.Selection(1)
  End If
  Set Vmapi = obj.Parent 'real foldername
  Vfolder = Vmapi.FolderPath
  'Debug.Print Vfolder
  If Application.ActiveExplorer.NavigationPane.CurrentModule.NavigationModuleType = 0 Then 'apparently in favorites
     ' Code for jumping to inbox in same store (pst)
  End If
  ' Code for jumping to actual folder in same store (pst)
End Sub
 
I'm not sure I understand your question. Your code already finds the folder that an Item belongs to. It's just "Item.Parent" to get the Folder Object and "Item.Parent.FolderPath" if you want the path to the folder as a string (e.g. "\\Default\Inbox"). This works for most normal Items.

Are you asking how you can then jump to that Folder in the Navigation Pane?
 
I'm not sure I understand your question. Your code already finds the folder that an Item belongs to. It's just "Item.Parent" to get the Folder Object and "Item.Parent.FolderPath" if you want the path to the folder as a string (e.g. "\\Default\Inbox"). This works for most normal Items.

Are you asking how you can then jump to that Folder in the Navigation Pane?
Yes, it does find the actual folder from the favorites or the foldername in a search folder (Unread/follow up), though the latter will not work because that search folder is in favorites too, but that is not the problem for now. So that part works. The problem is how to jump to the folder in the folder tree.
 
Similar threads
Thread starter Title Forum Replies Date
M Search message, then (1) Jump to folder & (2) Select message that you searched for Outlook VBA and Custom Forms 6
G Search Folders and Jump to Folder Outlook VBA and Custom Forms 2
Victor_50 Outlook 2019 Jump to folder from search folder Outlook VBA and Custom Forms 0
F Jump to Inbox folder when click on Favorite Using Outlook 8
R Search/Jump to a folder by typing its name Outlook VBA and Custom Forms 1
Victor_50 jump to actual folder from favorite Outlook VBA and Custom Forms 1
F Jump to Inbox folder when click on Favorite Using Outlook 0
T Outlook 2013: How did "Inbox" emails jump straight to the "Recover Deleted Items" Folder? Using Outlook 2
I jump to body in open message with one keyboard shortcut? Using Outlook 3
A In Contacts Phone List View, allow alpha jump w/single key, same as Card views Using Outlook 4
P Outlook 2003 no longer opens "without" Folder List Showing in Navigation Pane Using Outlook 2
S Create search-folder/rule/filter looking at FROM a distro list that has nested distro lists Using Outlook 1
T Outlook 2010 Emailed folder but no 'From-To-Subject' information. Date okay. Using Outlook 12
A How to open Excel file saved in Outlook folder? Outlook VBA and Custom Forms 4
A OL24 Calendar folder pane too narrow Using Outlook 9
E "Cannot display the folder. MS Outlook cannot access the specified file location" Using Outlook 8
S How to get the actual Public Folder path from Favourites Folders Outlook VBA and Custom Forms 3
D.Moore Outlook COM addins source folder Using Outlook 12
M Folder names - rich text Using Outlook 6
E Gmail folder -why, in .ost IMAP situation, as well as Googlemail folder? Using Outlook 0
J Saving Send emails to a folder on the server Outlook VBA and Custom Forms 65
J Outlook 2019 Pick the Folder Location to save send emails Outlook VBA and Custom Forms 0
macdotcom Outlook 365 Outlook folder export to PST archival tool - close, but need a nudge Outlook VBA and Custom Forms 2
B How to get PST folder datetime? Outlook VBA and Custom Forms 1
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
P Can't add custom field to custom Outlook form, it always adds to the Folder instead Outlook VBA and Custom Forms 2
P Yahoo/IMAP folder rename by Outlook desktop 365 Using Outlook 0
A Outlook 2019 folder counter Using Outlook 0
A Search folder and move the email Outlook VBA and Custom Forms 0
N Reply to Outlook messages by moving messages to a specific Outlook folder Outlook VBA and Custom Forms 1
T How to find or display the sub-folder name for an Archive Search Using Outlook 10
A Outlook 365 (OutLook For Mac)Move "On My Computer" Folder Items From Old To New Mac Computer Using Outlook 4
P Search folder: all emails sent to or from a domain Using Outlook 1
V Folder Properties - Gmail account can't switch Using Outlook 5
HarvMan Outlook 365 - Rule to Move an Incoming Message to Another Folder Using Outlook 4
S Email Macros to go to a SHARED Outlook mailbox Draft folder...NOT my personal Outlook Draft folder Using Outlook 2
I Help with Smart Folder + Query Builder on IMAP Using Outlook 0
S Paperclip icon shows without attachment in email under Sent folder Using Outlook 0
Kika Melo Outlook Calendar deleted appointments not in Deleted Items folder Using Outlook 3
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0
Z Outlook 365 Automatically assign categories to incoming mail in a shared folder Round Robin Outlook VBA and Custom Forms 1
G Adding a contact to a specific folder Using Outlook 0
Witzker Outlook 2019 Macro GoTo user defined search folder Outlook VBA and Custom Forms 6
Rupert Dragwater Duplicate email in Folder Using Outlook 7
S Adding a recipient's column to Sent folder in Outlook 2010 Outlook VBA and Custom Forms 1
L "Insert Pictures" Button-Wrong Folder Using Outlook 5
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
CWM330 Outlook 365 Hey Diane! MS 365 Biz Standard and "Potential Spam" addressed to others coming to my JUNK folder? Using Outlook 2
J Quick steps delete original email and move reply/sent email to folder Using Outlook 2
A manual rule sends mail to wrong folder Using Outlook 5

Similar threads

Back
Top