Function to return the full path to an Outlook Folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I came up with this function to return the full path to any particular
folder. I can't see any issues with it, however - please feel free to break
it, if it can be. (Yeah so I didn't declare the variables in the example...)

Public Function getFullFolderPath()

Set nms = Outlook.Application.GetNamespace("MAPI")
Set targetFolder = nms.PickFolder

strPath = targetFolder

While targetFolder.Parent <> "Outlook"
strPath = targetFolder.Parent & "\" & strPath
Set targetFolder = targetFolder.Parent
Wend

Set targetFolder = Nothing
Set nms = Nothing

getFullFolderPath = strPath

End Function
 
Probably because I'm not familar with that. Also, isn't it only available in
Outlook 2007? The bigger picture is to get the full folder path after a user
selects any folder.
 
Back
Top