![]() |
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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi
We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
Ads |
#2
|
|||
|
|||
![]() You already have code for extracting mails to Excel. What is your question now? BTW: I'd say, you urgently have to switch your system away from folders to categories. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Tue, 28 Nov 2006 18:47:00 -0800 schrieb Vadhimoo: Hi We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
#3
|
|||
|
|||
![]()
Dear Michael,
Thanks.I know extract mails from INBOX. My question is in our INBOX having more than 2000 sub folders. I want to extract all my sub folders name to excel or access. Like... Inbox USA2000 Newzeland2002 ........... "Michael Bauer [MVP - Outlook]" wrote: You already have code for extracting mails to Excel. What is your question now? BTW: I'd say, you urgently have to switch your system away from folders to categories. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Tue, 28 Nov 2006 18:47:00 -0800 schrieb Vadhimoo: Hi We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
#4
|
|||
|
|||
![]()
This Outlook VBA sample code (from my forthcoming Outlook 2007 programming book recurses the entire folder hierarchy to build a string (mstrList) of all the folders along with the number of items in each one.
Dim mlngItemCount As Long Dim mlngFolderCount As Long Dim mstrList As String Sub ListAllFolders() Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.Folder Dim objMsg As Outlook.MailItem mlngItemCount = 0 mlngFolderCount = 0 mstrList = "" Set objOL = Application Set objNS = objOL.Session For Each objFolder In objNS.Folders Call ProcessFolder(objFolder) mstrList = mstrList & vbCrLf Next Set objMsg = objOL.CreateItem(olMailItem) mstrList = mstrList & vbCrLf & _ "Total folders in Outlook = " & _ Format(mlngFolderCount, "###,###") & _ vbCrLf & "Total items in Outlook = " & _ Format(mlngItemCount, "###,###") objMsg.Body = mstrList objMsg.Display Set objOL = Nothing Set objNS = Nothing Set objFolder = Nothing End Sub Sub ProcessFolder(startFolder As Outlook.Folder) Dim objFolder As Outlook.Folder On Error Resume Next mstrList = mstrList & vbCrLf & startFolder.FolderPath & _ vbTab & startFolder.Items.Count mlngItemCount = mlngItemCount + startFolder.Items.Count mlngFolderCount = mlngFolderCount + 1 For Each objFolder In startFolder.Folders Call ProcessFolder(objFolder) Next Set objFolder = Nothing End Sub -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Vadhimoo" wrote in message news ![]() Hi We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
#5
|
|||
|
|||
![]() So your question is not how to write data into Excel, but how to read Outlook's folder hierarchy. Please see Sue's answer. I'd maybe have answered the Excel part - and wasted my time :-) -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Wed, 29 Nov 2006 01:23:03 -0800 schrieb Vadhimoo: Dear Michael, Thanks.I know extract mails from INBOX. My question is in our INBOX having more than 2000 sub folders. I want to extract all my sub folders name to excel or access. Like... Inbox USA2000 Newzeland2002 ........... "Michael Bauer [MVP - Outlook]" wrote: You already have code for extracting mails to Excel. What is your question now? BTW: I'd say, you urgently have to switch your system away from folders to categories. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Tue, 28 Nov 2006 18:47:00 -0800 schrieb Vadhimoo: Hi We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
#6
|
|||
|
|||
![]()
Dear Sue Mosher,
Good Morning , Thanks for your response.When i run the below code. I got the Compile Error. For this line: Sub ProcessFolder(startFolder As Outlook.Folder) Error is: Used-defined type not defined. I am using Microsoft Outlook 2003.Please assist me.Have a nice day. Dear Michael Bauer, We cant able to view the "Thread " Answer for the last three days.I sent a mail to microsoft helpdesk at ". Today only we view this thread. Have a nice day. Thanks and Regards, Vadhimoo. "Sue Mosher [MVP-Outlook]" wrote: This Outlook VBA sample code (from my forthcoming Outlook 2007 programming book recurses the entire folder hierarchy to build a string (mstrList) of all the folders along with the number of items in each one. Dim mlngItemCount As Long Dim mlngFolderCount As Long Dim mstrList As String Sub ListAllFolders() Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.Folder Dim objMsg As Outlook.MailItem mlngItemCount = 0 mlngFolderCount = 0 mstrList = "" Set objOL = Application Set objNS = objOL.Session For Each objFolder In objNS.Folders Call ProcessFolder(objFolder) mstrList = mstrList & vbCrLf Next Set objMsg = objOL.CreateItem(olMailItem) mstrList = mstrList & vbCrLf & _ "Total folders in Outlook = " & _ Format(mlngFolderCount, "###,###") & _ vbCrLf & "Total items in Outlook = " & _ Format(mlngItemCount, "###,###") objMsg.Body = mstrList objMsg.Display Set objOL = Nothing Set objNS = Nothing Set objFolder = Nothing End Sub Sub ProcessFolder(startFolder As Outlook.Folder) Dim objFolder As Outlook.Folder On Error Resume Next mstrList = mstrList & vbCrLf & startFolder.FolderPath & _ vbTab & startFolder.Items.Count mlngItemCount = mlngItemCount + startFolder.Items.Count mlngFolderCount = mlngFolderCount + 1 For Each objFolder In startFolder.Folders Call ProcessFolder(objFolder) Next Set objFolder = Nothing End Sub -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Vadhimoo" wrote in message news ![]() Hi We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
#7
|
|||
|
|||
![]() Vadhimoo, the declaration of: startFolder as Outlook.Folder is for OL 2007. For earlier versions it's startFolder as Outlook.Mapifolder -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Tue, 5 Dec 2006 00:39:37 -0800 schrieb Vadhimoo: Dear Sue Mosher, Good Morning , Thanks for your response.When i run the below code. I got the Compile Error. For this line: Sub ProcessFolder(startFolder As Outlook.Folder) Error is: Used-defined type not defined. I am using Microsoft Outlook 2003.Please assist me.Have a nice day. Dear Michael Bauer, We cant able to view the "Thread " Answer for the last three days.I sent a mail to microsoft helpdesk at ". Today only we view this thread. Have a nice day. Thanks and Regards, Vadhimoo. "Sue Mosher [MVP-Outlook]" wrote: This Outlook VBA sample code (from my forthcoming Outlook 2007 programming book recurses the entire folder hierarchy to build a string (mstrList) of all the folders along with the number of items in each one. Dim mlngItemCount As Long Dim mlngFolderCount As Long Dim mstrList As String Sub ListAllFolders() Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.Folder Dim objMsg As Outlook.MailItem mlngItemCount = 0 mlngFolderCount = 0 mstrList = "" Set objOL = Application Set objNS = objOL.Session For Each objFolder In objNS.Folders Call ProcessFolder(objFolder) mstrList = mstrList & vbCrLf Next Set objMsg = objOL.CreateItem(olMailItem) mstrList = mstrList & vbCrLf & _ "Total folders in Outlook = " & _ Format(mlngFolderCount, "###,###") & _ vbCrLf & "Total items in Outlook = " & _ Format(mlngItemCount, "###,###") objMsg.Body = mstrList objMsg.Display Set objOL = Nothing Set objNS = Nothing Set objFolder = Nothing End Sub Sub ProcessFolder(startFolder As Outlook.Folder) Dim objFolder As Outlook.Folder On Error Resume Next mstrList = mstrList & vbCrLf & startFolder.FolderPath & _ vbTab & startFolder.Items.Count mlngItemCount = mlngItemCount + startFolder.Items.Count mlngFolderCount = mlngFolderCount + 1 For Each objFolder In startFolder.Folders Call ProcessFolder(objFolder) Next Set objFolder = Nothing End Sub -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Vadhimoo" wrote in message news ![]() Hi We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
#8
|
|||
|
|||
![]()
Sorry about that. GOod catch, Michael.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Michael Bauer [MVP - Outlook]" wrote in message .. . Vadhimoo, the declaration of: startFolder as Outlook.Folder is for OL 2007. For earlier versions it's startFolder as Outlook.Mapifolder -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Tue, 5 Dec 2006 00:39:37 -0800 schrieb Vadhimoo: Dear Sue Mosher, Good Morning , Thanks for your response.When i run the below code. I got the Compile Error. For this line: Sub ProcessFolder(startFolder As Outlook.Folder) Error is: Used-defined type not defined. I am using Microsoft Outlook 2003.Please assist me.Have a nice day. Dear Michael Bauer, We cant able to view the "Thread " Answer for the last three days.I sent a mail to microsoft helpdesk at ". Today only we view this thread. Have a nice day. Thanks and Regards, Vadhimoo. "Sue Mosher [MVP-Outlook]" wrote: This Outlook VBA sample code (from my forthcoming Outlook 2007 programming book recurses the entire folder hierarchy to build a string (mstrList) of all the folders along with the number of items in each one. Dim mlngItemCount As Long Dim mlngFolderCount As Long Dim mstrList As String Sub ListAllFolders() Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.Folder Dim objMsg As Outlook.MailItem mlngItemCount = 0 mlngFolderCount = 0 mstrList = "" Set objOL = Application Set objNS = objOL.Session For Each objFolder In objNS.Folders Call ProcessFolder(objFolder) mstrList = mstrList & vbCrLf Next Set objMsg = objOL.CreateItem(olMailItem) mstrList = mstrList & vbCrLf & _ "Total folders in Outlook = " & _ Format(mlngFolderCount, "###,###") & _ vbCrLf & "Total items in Outlook = " & _ Format(mlngItemCount, "###,###") objMsg.Body = mstrList objMsg.Display Set objOL = Nothing Set objNS = Nothing Set objFolder = Nothing End Sub Sub ProcessFolder(startFolder As Outlook.Folder) Dim objFolder As Outlook.Folder On Error Resume Next mstrList = mstrList & vbCrLf & startFolder.FolderPath & _ vbTab & startFolder.Items.Count mlngItemCount = mlngItemCount + startFolder.Items.Count mlngFolderCount = mlngFolderCount + 1 For Each objFolder In startFolder.Folders Call ProcessFolder(objFolder) Next Set objFolder = Nothing End Sub -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Vadhimoo" wrote in message news ![]() Hi We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
#9
|
|||
|
|||
![]() That's easy as I'm still living in the "old world" :-) -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Tue, 5 Dec 2006 08:29:26 -0500 schrieb Sue Mosher [MVP-Outlook]: Sorry about that. GOod catch, Michael. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Michael Bauer [MVP - Outlook]" wrote in message .. . Vadhimoo, the declaration of: startFolder as Outlook.Folder is for OL 2007. For earlier versions it's startFolder as Outlook.Mapifolder -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Tue, 5 Dec 2006 00:39:37 -0800 schrieb Vadhimoo: Dear Sue Mosher, Good Morning , Thanks for your response.When i run the below code. I got the Compile Error. For this line: Sub ProcessFolder(startFolder As Outlook.Folder) Error is: Used-defined type not defined. I am using Microsoft Outlook 2003.Please assist me.Have a nice day. Dear Michael Bauer, We cant able to view the "Thread " Answer for the last three days.I sent a mail to microsoft helpdesk at ". Today only we view this thread. Have a nice day. Thanks and Regards, Vadhimoo. "Sue Mosher [MVP-Outlook]" wrote: This Outlook VBA sample code (from my forthcoming Outlook 2007 programming book recurses the entire folder hierarchy to build a string (mstrList) of all the folders along with the number of items in each one. Dim mlngItemCount As Long Dim mlngFolderCount As Long Dim mstrList As String Sub ListAllFolders() Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.Folder Dim objMsg As Outlook.MailItem mlngItemCount = 0 mlngFolderCount = 0 mstrList = "" Set objOL = Application Set objNS = objOL.Session For Each objFolder In objNS.Folders Call ProcessFolder(objFolder) mstrList = mstrList & vbCrLf Next Set objMsg = objOL.CreateItem(olMailItem) mstrList = mstrList & vbCrLf & _ "Total folders in Outlook = " & _ Format(mlngFolderCount, "###,###") & _ vbCrLf & "Total items in Outlook = " & _ Format(mlngItemCount, "###,###") objMsg.Body = mstrList objMsg.Display Set objOL = Nothing Set objNS = Nothing Set objFolder = Nothing End Sub Sub ProcessFolder(startFolder As Outlook.Folder) Dim objFolder As Outlook.Folder On Error Resume Next mstrList = mstrList & vbCrLf & startFolder.FolderPath & _ vbTab & startFolder.Items.Count mlngItemCount = mlngItemCount + startFolder.Items.Count mlngFolderCount = mlngFolderCount + 1 For Each objFolder In startFolder.Folders Call ProcessFolder(objFolder) Next Set objFolder = Nothing End Sub -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Vadhimoo" wrote in message news ![]() Hi We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
#10
|
|||
|
|||
![]()
Dear Sue Mosher/Michael Bauer,
I changed as Outlook.MAPIfolder and run the code.I was waiting for around three hours,in order to get the result of this macro.Then i debugged and found ,it starts from" Public Folders". Please find my Puplic folders Tree: Puplic Folders All Public Folders Suppliers AT&T MCI ..... ...... (1500 Suppliers , Each folder having atleast 10,000 mails) Customers Orange Tele2UK ......... .........(Around 1000 Customers, Each folder having atleast 10,000 mails) Huge Folders-Is it may be the reason? can you do one favor for me ? Instead of extract Public folders name, i want to extract my Mailbox Folders name: Ex: Mailbox - Vadhimoo Drafts Inbox Legault L2002 L2000 Eric E2002 E2000 Analyse Reseach2000 Research2002 Journal Notes Test2000 Test2002 Thanks and Regards, Vadhimoo. "Michael Bauer [MVP - Outlook]" wrote: That's easy as I'm still living in the "old world" :-) -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Tue, 5 Dec 2006 08:29:26 -0500 schrieb Sue Mosher [MVP-Outlook]: Sorry about that. GOod catch, Michael. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Michael Bauer [MVP - Outlook]" wrote in message .. . Vadhimoo, the declaration of: startFolder as Outlook.Folder is for OL 2007. For earlier versions it's startFolder as Outlook.Mapifolder -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Am Tue, 5 Dec 2006 00:39:37 -0800 schrieb Vadhimoo: Dear Sue Mosher, Good Morning , Thanks for your response.When i run the below code. I got the Compile Error. For this line: Sub ProcessFolder(startFolder As Outlook.Folder) Error is: Used-defined type not defined. I am using Microsoft Outlook 2003.Please assist me.Have a nice day. Dear Michael Bauer, We cant able to view the "Thread " Answer for the last three days.I sent a mail to microsoft helpdesk at ". Today only we view this thread. Have a nice day. Thanks and Regards, Vadhimoo. "Sue Mosher [MVP-Outlook]" wrote: This Outlook VBA sample code (from my forthcoming Outlook 2007 programming book recurses the entire folder hierarchy to build a string (mstrList) of all the folders along with the number of items in each one. Dim mlngItemCount As Long Dim mlngFolderCount As Long Dim mstrList As String Sub ListAllFolders() Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.Folder Dim objMsg As Outlook.MailItem mlngItemCount = 0 mlngFolderCount = 0 mstrList = "" Set objOL = Application Set objNS = objOL.Session For Each objFolder In objNS.Folders Call ProcessFolder(objFolder) mstrList = mstrList & vbCrLf Next Set objMsg = objOL.CreateItem(olMailItem) mstrList = mstrList & vbCrLf & _ "Total folders in Outlook = " & _ Format(mlngFolderCount, "###,###") & _ vbCrLf & "Total items in Outlook = " & _ Format(mlngItemCount, "###,###") objMsg.Body = mstrList objMsg.Display Set objOL = Nothing Set objNS = Nothing Set objFolder = Nothing End Sub Sub ProcessFolder(startFolder As Outlook.Folder) Dim objFolder As Outlook.Folder On Error Resume Next mstrList = mstrList & vbCrLf & startFolder.FolderPath & _ vbTab & startFolder.Items.Count mlngItemCount = mlngItemCount + startFolder.Items.Count mlngFolderCount = mlngFolderCount + 1 For Each objFolder In startFolder.Folders Call ProcessFolder(objFolder) Next Set objFolder = Nothing End Sub -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Vadhimoo" wrote in message news ![]() We are having more than 2000 folders in our INBOX. We would like to extract all the folders name to excel. How can we extract all the folders name..? Thanks in advance for your reply. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I extract calendar usage data from Outlook | Stout | Outlook - Calandaring | 1 | August 28th 06 09:53 PM |
extract all the text from a email in outlook | .·:m·a·r·l·a:·. | Outlook - General Queries | 4 | August 19th 06 08:50 PM |
Extract Outlook Address book properties into Excel | Junoon | Outlook and VBA | 11 | June 30th 06 01:17 AM |
How to open Public Folders 'Contact Form' using VBA | mmattson | Outlook and VBA | 1 | May 17th 06 11:06 PM |
How do I extract and use the info fields from "form mail" email to | Sean | Outlook - Using Forms | 1 | February 1st 06 12:53 AM |