View Single Post
  #7  
Old May 20th 08, 08:54 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Can't move items

The code looks OK. I'm wondering if a delay would make any difference, i.e:

Dim mail As MailItem

DoEvents

Set mail = Item

DoEvents

Set tempMail = mail.Move(mSpCurrentFolder)

Other than that I'm out of ideas.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


Kiran wrote in message ...
Hello Ken,

I checked the properties of the mail in 2 instances. The Parent is set to
moved folder 'X' in first move. During second move, the parent is set to
source folder 'A'. If I do not monitor Items of folder 'A', then there is
no issue. But I need to monitor folder 'A' also.

Here is my ItemAdd handler.
Private Sub mEncryptedItems_ItemAdd(ByVal Item As Object)
'Check password
'If pass word is invalid
Dim mail As MailItem
Set mail = Item
Set tempMail = mail.Move(mSpCurrentFolder)
Set tempMail = Nothing

End Sub

I even tried dereferencing the mail by setting it to Nothing and then use
GetItemFromID(entryID, storeID). But no use.

Thanks & Regards,
Kiran


Ads