Extract Folders Name From Outlook to Excel

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

Guest

Hi ,
In our outlook, we have more than 200 sub folders.
Like INBOX
Jan2000_USA
Feb2000_UK
................
Now we want to modify the sub folders name. So that can you suggest how to
Extracting all the outlook folders name to excel.

Thanks in advance in your reply
 
Private R As Integer

Sub ListOLinboxFolders()

Const olFolderInbox = 6

R = 0

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")

Set objInbox = objNamespace.GetDefaultFolder(olFolderInbox)

GetSubfolders objInbox

Set objNamespace = Nothing
Set objOutlook = Nothing

End Sub

Sub GetSubfolders(objParentFolder)

R = R + 1

Set colFolders = objParentFolder.Folders
For Each objFolder In colFolders
Set objSubfolder = objParentFolder.Folders(objFolder.Name)
Cells(R, 1).Value = objFolder.Name
GetSubfolders objSubfolder
Next objFolder
End Sub

_____________________________

Steve
 
Hi,
I saw this post and it was very helpful. Is there a way from excel vba to
copy a specific file (word.doc) into a specific outlook mail folder?

Tahanks for any help.

peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top