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

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