A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Function to return the full path to an Outlook Folder



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Full folder path in Outlook 2003 search? Anonymous Chief Outlook - General Queries 2 August 31st 07 10:11 PM
File location or full path Vette Miester Outlook Express 1 March 4th 07 04:50 PM
MailItem Folder Path Fox via OfficeKB.com Outlook and VBA 1 July 7th 06 02:39 PM
Getting an Outlook folder using a path Paddy Outlook and VBA 2 May 25th 06 09:32 PM
Getting a folder give a path Paddy Outlook and VBA 4 May 25th 06 08:53 PM


All times are GMT +1. The time now is 07:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.