|
|
Question : Outlook add-in error: "The item has been moved or deleted" URGENT
|
|
My problem is to work with more than one instance of e-mail (MailItem). When I try to send a mail item the send method works fine, but when I open two or more e-mails, send one and then send other, the e-mail object (MailItem) doesn't have the properties anymore returning the error message: "The item has been moved or deleted".
When the e-mail is sent, the e-mail object (MailItem) loses all its properties.
{Please do not post emails/websites in signature in questions - ee_ai_construct, cs admin}
|
Answer : Outlook add-in error: "The item has been moved or deleted" URGENT
|
|
caiodop,
It sounds as if the mail item you are trying to send is no longer an active mailitem. This would be true if your user opens an email and returns to the outlook window and opens a second email. After the send event has taken place, windows returns to the previous window that was active, and in this case it returns to the Outlook Window.
In order to be able to send the first email you will firstly have to make it current. In the windows environment this would be by clicking on the mailitem button on the task bar or by ALT-Tabbing.
To implement this in code, you will need to use the Active Inspector method. This returns the topmost Inspector object on the desktop. If no inspector is active, returns Nothing. Use this method to access the Inspector object that the user is most likely to be viewing.
A sample of its use in the VBA environment (from the VBA help) is: -
Set myOlApp = CreateObject("Outlook.Application") Set myInspector = myOlApp.ActiveInspector MsgBox "The active item is " & myInspector.CurrentItem.Subject
Tom.
|
|
|
|
|