ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extract Folders Name From Outlook to Excel (https://www.excelbanter.com/excel-programming/378643-extract-folders-name-outlook-excel.html)

Vadhimoo

Extract Folders Name From Outlook to Excel
 
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

Steve Yandl

Extract Folders Name From Outlook to Excel
 
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


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




peter

Extract Folders Name From Outlook to Excel
 
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


"Steve Yandl" wrote:

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


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






All times are GMT +1. The time now is 02:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com