View Single Post
  #2  
Old November 14th 07, 04:44 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Function to return the full path to an Outlook Folder

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