![]() |
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
|
|||
|
|||
![]()
Is there a way to move all messages in my inbox to my personal archive
folder into a subfolder with the email name that each email is from (if it doesn't already exist).\ I am pretty proficient with VBA in MS Excel and have dabbled with VBScript, therefore I may need some basic instructions on how to put this final package together as well. TIA for any help... Mark Ivey |
#2
|
|||
|
|||
![]() Do you want to move the messages into an Outlook folder or the file system? -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Quick-Cats - Categorize Outlook data: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Sun, 13 May 2007 19:47:36 -0500 schrieb Mark Ivey: Is there a way to move all messages in my inbox to my personal archive folder into a subfolder with the email name that each email is from (if it doesn't already exist).\ I am pretty proficient with VBA in MS Excel and have dabbled with VBScript, therefore I may need some basic instructions on how to put this final package together as well. TIA for any help... Mark Ivey |
#3
|
|||
|
|||
![]()
Michael,
Thanks for your reply... I actually got my answer in another thread: Here is my finished product if anyone was interested: __________________________________________________ ________________________________ Special thanks to: Eric Legault, Steven Harvey, and Sue Mosher for helping derive the version posted below. __________________________________________________ ________________________________ Sub ArchiveToFolder() On Error Resume Next Dim objFolder As Outlook.MAPIFolder, objInbox As Outlook.MAPIFolder Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem Dim myFolder As String myFolder = Format(Date, "yyyy") ' My personal folder is labeled as the current year (ie - '2007') Set objNS = Application.GetNamespace("MAPI") Set objInbox = objNS.GetDefaultFolder(olFolderInbox) Set objFolder = objNS.Folders(myFolder) If Application.ActiveExplorer.Selection.Count = 0 Then 'Require that this procedure be called only when a message is selected Exit Sub End If For Each objItem In Application.ActiveExplorer.Selection If FolderExist(objItem.SenderName) = False Then objFolder.Folders.Add (objItem.SenderName) End If Set objFolder = objNS.Folders(myFolder).Folders(objItem.SenderName ) If objFolder.DefaultItemType = olMailItem Then If objItem.Class = olMail Then objItem.Move objFolder Set objFolder = objNS.Folders(myFolder) End If End If Next Set objItem = Nothing Set objFolder = Nothing Set objInbox = Nothing Set objNS = Nothing End Sub Function FolderExist(sFileName As String) As Boolean FolderExist = IIf(Dir(sFileName, vbDirectory) "", True, False) End Function __________________________________________________ ________________________________ Mark Ivey "Michael Bauer [MVP - Outlook]" wrote in message .. . Do you want to move the messages into an Outlook folder or the file system? -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Quick-Cats - Categorize Outlook data: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Sun, 13 May 2007 19:47:36 -0500 schrieb Mark Ivey: Is there a way to move all messages in my inbox to my personal archive folder into a subfolder with the email name that each email is from (if it doesn't already exist).\ I am pretty proficient with VBA in MS Excel and have dabbled with VBScript, therefore I may need some basic instructions on how to put this final package together as well. TIA for any help... Mark Ivey |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
protecting specific designated emails from auto-archiving/deleting | Barry | Outlook - General Queries | 4 | October 25th 07 02:20 AM |
Backup and archiving emails? | ***** charles | Outlook Express | 4 | January 25th 07 10:14 PM |
archiving emails simultaneously | nan | Outlook - General Queries | 1 | December 21st 06 11:14 AM |
linked emails after archiving | Tricky7 | Outlook - Using Contacts | 3 | December 9th 06 12:34 AM |
Auto-Archiving of employee´s emails - solution needed | Uli | Add-ins for Outlook | 0 | August 6th 06 06:38 PM |