![]() |
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
|
|||
|
|||
![]()
I'm trying somehow to imitate Gmail feature, which moves archived items back
into the Inbox when a new email with the same subject line arrives. I have implemented following which will be called each time an email arrives and moves all emails with same Conversation topic back to the Inbox. It seems to work, but takes very long with only 1400 items in my Archive folder. Any idea how I can speed this up? Thanks Kemal Sub Test() MoveEmails ("Considered test defects") End Sub Sub MoveEmails(myConvTopic As String) Dim persFolders, myArchiveFolder, myDestFolder As Outlook.MAPIFolder Dim i As Integer Dim myItem As Outlook.MailItem Set myDestFolder = Application.Session.GetDefaultFolder(olFolderInbox ) Set persFolders = Application.Session.Folders.Item(3) Set myArchiveFolder = persFolders.Folders.Item(7) mailCount = myArchiveFolder.Items.Count For i = mailCount To 1 Step -1 If myArchiveFolder.Items(i).Class = olMail Then Set myItem = myArchiveFolder.Items(i) If myItem.ConversationTopic = myConvTopic Then myItem.Move myDestFolder End If End If Next End Sub |
#2
|
|||
|
|||
![]()
Am Thu, 25 May 2006 20:29:01 -0700 schrieb Kemal:
Try the CDO 1.21 or Redemption (www.dimastr.com) objects which loops are a lot faster. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- I'm trying somehow to imitate Gmail feature, which moves archived items back into the Inbox when a new email with the same subject line arrives. I have implemented following which will be called each time an email arrives and moves all emails with same Conversation topic back to the Inbox. It seems to work, but takes very long with only 1400 items in my Archive folder. Any idea how I can speed this up? Thanks Kemal Sub Test() MoveEmails ("Considered test defects") End Sub Sub MoveEmails(myConvTopic As String) Dim persFolders, myArchiveFolder, myDestFolder As Outlook.MAPIFolder Dim i As Integer Dim myItem As Outlook.MailItem Set myDestFolder = Application.Session.GetDefaultFolder(olFolderInbox ) Set persFolders = Application.Session.Folders.Item(3) Set myArchiveFolder = persFolders.Folders.Item(7) mailCount = myArchiveFolder.Items.Count For i = mailCount To 1 Step -1 If myArchiveFolder.Items(i).Class = olMail Then Set myItem = myArchiveFolder.Items(i) If myItem.ConversationTopic = myConvTopic Then myItem.Move myDestFolder End If End If Next End Sub |
#3
|
|||
|
|||
![]()
Thanks a lot for the link.
I started but got stuck when trying to access the "_myArchive" folder in "Personal Folders": ...... Set myRDOSession = CreateObject("Redemption.RDOSession") myRDOSession.Logon Set myRDODestFolder = myRDOSession.GetDefaultFolder(olFolderInbox) Set myRDOArchiveFolder = myRDOSession.Stores.DefaultStore.IPMRootFolder.Fol ders("_Archive") the line above is not working I also would appreciate if you could look at the code below. I couldn't test it yet. mailCount = myRDOArchiveFolder.Items.Count For i = mailCount - 1 To 1 Step -1 If myRDOArchiveFolder.Items(i).Class = olMail Then Set myRDOItem = myRDOArchiveFolder.Items(i) ct = ct + 1 If myRDOItem.ConversationTopic = myConvTopic Then ct2 = ct2 + 1 'myRDOItem.Move myDestFolder End If End If Next End Sub Thanks Kemal "Michael Bauer" wrote: Am Thu, 25 May 2006 20:29:01 -0700 schrieb Kemal: Try the CDO 1.21 or Redemption (www.dimastr.com) objects which loops are a lot faster. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- I'm trying somehow to imitate Gmail feature, which moves archived items back into the Inbox when a new email with the same subject line arrives. I have implemented following which will be called each time an email arrives and moves all emails with same Conversation topic back to the Inbox. It seems to work, but takes very long with only 1400 items in my Archive folder. Any idea how I can speed this up? Thanks Kemal Sub Test() MoveEmails ("Considered test defects") End Sub Sub MoveEmails(myConvTopic As String) Dim persFolders, myArchiveFolder, myDestFolder As Outlook.MAPIFolder Dim i As Integer Dim myItem As Outlook.MailItem Set myDestFolder = Application.Session.GetDefaultFolder(olFolderInbox ) Set persFolders = Application.Session.Folders.Item(3) Set myArchiveFolder = persFolders.Folders.Item(7) mailCount = myArchiveFolder.Items.Count For i = mailCount To 1 Step -1 If myArchiveFolder.Items(i).Class = olMail Then Set myItem = myArchiveFolder.Items(i) If myItem.ConversationTopic = myConvTopic Then myItem.Move myDestFolder End If End If Next End Sub |
#4
|
|||
|
|||
![]()
Am Fri, 26 May 2006 09:41:02 -0700 schrieb Kemal:
According to your previous sample you should get access to the folder "_Archive" - as long as itīs the correct name and if itīs contained within your default store. Except you donīt actually want to process also the last item, your loop must start at mailCount, not mailCount-1. The RDOMail doesnīt support a Class property but a MessageClass. Because RDOMail is able to access every item in your Inbox, you maybe donīt need to check the item type first? So the code could look like this: Dim Items as RdoItems Dim Mail as RdoMail Set Items=myRdoArchiveFolder.Items For i=Items.Count to 1 Step -1 Set Mail=Items(i) ' if necessary for your logic you can check the MessageClass ' property here Next -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- Thanks a lot for the link. I started but got stuck when trying to access the "_myArchive" folder in "Personal Folders": ..... Set myRDOSession = CreateObject("Redemption.RDOSession") myRDOSession.Logon Set myRDODestFolder = myRDOSession.GetDefaultFolder(olFolderInbox) Set myRDOArchiveFolder = myRDOSession.Stores.DefaultStore.IPMRootFolder.Fol ders("_Archive") the line above is not working I also would appreciate if you could look at the code below. I couldn't test it yet. mailCount = myRDOArchiveFolder.Items.Count For i = mailCount - 1 To 1 Step -1 If myRDOArchiveFolder.Items(i).Class = olMail Then Set myRDOItem = myRDOArchiveFolder.Items(i) ct = ct + 1 If myRDOItem.ConversationTopic = myConvTopic Then ct2 = ct2 + 1 'myRDOItem.Move myDestFolder End If End If Next End Sub Thanks Kemal "Michael Bauer" wrote: Am Thu, 25 May 2006 20:29:01 -0700 schrieb Kemal: Try the CDO 1.21 or Redemption (www.dimastr.com) objects which loops are a lot faster. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- I'm trying somehow to imitate Gmail feature, which moves archived items back into the Inbox when a new email with the same subject line arrives. I have implemented following which will be called each time an email arrives and moves all emails with same Conversation topic back to the Inbox. It seems to work, but takes very long with only 1400 items in my Archive folder. Any idea how I can speed this up? Thanks Kemal Sub Test() MoveEmails ("Considered test defects") End Sub Sub MoveEmails(myConvTopic As String) Dim persFolders, myArchiveFolder, myDestFolder As Outlook.MAPIFolder Dim i As Integer Dim myItem As Outlook.MailItem Set myDestFolder = Application.Session.GetDefaultFolder(olFolderInbox ) Set persFolders = Application.Session.Folders.Item(3) Set myArchiveFolder = persFolders.Folders.Item(7) mailCount = myArchiveFolder.Items.Count For i = mailCount To 1 Step -1 If myArchiveFolder.Items(i).Class = olMail Then Set myItem = myArchiveFolder.Items(i) If myItem.ConversationTopic = myConvTopic Then myItem.Move myDestFolder End If End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Speed Dialing - Outlook 2002 | Bernard | Outlook - Using Contacts | 0 | May 23rd 06 04:55 PM |
Outlook 2002 Speed Dialing | Bernard | Outlook - Using Contacts | 0 | May 15th 06 09:51 AM |
Moving Specific Inbox Items to a Specific Subfolder (VBA) | DevDaniel | Outlook and VBA | 1 | April 11th 06 05:46 AM |
Moving items to folders does not work | SSI | Outlook - General Queries | 0 | February 8th 06 04:11 AM |
Moving a Mix of Mail Items and Report Items | Steve Roberts | Outlook and VBA | 1 | January 24th 06 10:36 PM |