U
U3RlRmV0Uw
Hello,
What we have done at work is to create a thread
In the Inspector Clos event :
If RemoveItemAfterClose Then
Dim TS As New System.Threading.ThreadStart(AddressOf
WrapperMailItem.Delete)
Dim t As System.Threading.Thread = New System.Threading.Thread(TS)
Try
t.Start()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End If
Works like a charm
wrote:
> Close is synchronous but you can't delete the item in that event handler
> without errors in some versions of Outlook.
> Outlook also caches items so you have to wait for it to be released.
> I usually use a timer to do the deletions and set up an array of EntryID's
> of items to delete. When the timer fires I sweep the array clean.
> >
>
> "Alan Moseley" <AlanMoseley> wrote in message
> news:FC96CDD9-F303-45BC-9B94-4271DC8B3969@microsoft.com...
> >I do not know for certain if it is synchronous or not, but I suspect that
> >it
> > is. Can you post the relevant section of your code. I suspect that you
> > are
> > under certain circumstances not setting the mailitem's object variable
> > back
> > to nothing before deleting the folder. Also, calling the mailitem's
> > delete
> > method invokes the inspector to close anyway, so you probably do not need
> > to
> > call it separately.
> > > > Alan Moseley IT Consultancy
> > http://www.amitc.co.uk
> > If I have solved your problem, please click Yes below. Thanks.
>
What we have done at work is to create a thread
In the Inspector Clos event :
If RemoveItemAfterClose Then
Dim TS As New System.Threading.ThreadStart(AddressOf
WrapperMailItem.Delete)
Dim t As System.Threading.Thread = New System.Threading.Thread(TS)
Try
t.Start()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End If
Works like a charm
wrote:
> Close is synchronous but you can't delete the item in that event handler
> without errors in some versions of Outlook.
> Outlook also caches items so you have to wait for it to be released.
> I usually use a timer to do the deletions and set up an array of EntryID's
> of items to delete. When the timer fires I sweep the array clean.
> >
>
> "Alan Moseley" <AlanMoseley> wrote in message
> news:FC96CDD9-F303-45BC-9B94-4271DC8B3969@microsoft.com...
> >I do not know for certain if it is synchronous or not, but I suspect that
> >it
> > is. Can you post the relevant section of your code. I suspect that you
> > are
> > under certain circumstances not setting the mailitem's object variable
> > back
> > to nothing before deleting the folder. Also, calling the mailitem's
> > delete
> > method invokes the inspector to close anyway, so you probably do not need
> > to
> > call it separately.
> > > > Alan Moseley IT Consultancy
> > http://www.amitc.co.uk
> > If I have solved your problem, please click Yes below. Thanks.
>