View Single Post
  #3  
Old November 14th 07, 12:06 PM posted to microsoft.public.outlook.program_vba
dch3
external usenet poster
 
Posts: 105
Default Function to return the full path to an Outlook Folder

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.

"Dmitry Streblechenko" wrote:

Why not use the MAPIFolder.FullFolderPath property?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dch3" wrote in message
...
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




Ads