A
|{arl Shtoshek
Hi, All!
Is there ANY way to determine if the MailItem is being deleted in its
MailItem_Close event?
I'm doing a check whether the MailItem is changed and if it is, I
display the "Do you want to save changes?" dialog (with a
MsgBox(...)). If the user chooses "Yes", I call Inspector.Close
olSave. Here "Inspector" is the wrapper class which contains the
MailItem object.
The problem is - if the MailItem is changed, but is being deleted, I'm
displaying the "do you want to save changes" dialog anyway, because I
don't know that it's being deleted.
I'm using VB6 and developing for OL2000
The code looks somewhat like this:
Private Sub m_objMail_Close(Cancel As Boolean)
Dim iRetVal As Integer
If m_objMail.Saved = False Then
'Here I would like to know if m_objMail is being deleted
iRetVal = MsgBox("Save changes?", vbYesNoCancel)
Select Case iRetVal
Case vbYes
m_objInsp.Close olSave
Case vbNo
m_objInsp.Close olDiscard
Case vbCancel
Cancel = True
End Select
Else
m_objInsp.Close olDiscard
End If
End Sub
TIA,
Karls
Is there ANY way to determine if the MailItem is being deleted in its
MailItem_Close event?
I'm doing a check whether the MailItem is changed and if it is, I
display the "Do you want to save changes?" dialog (with a
MsgBox(...)). If the user chooses "Yes", I call Inspector.Close
olSave. Here "Inspector" is the wrapper class which contains the
MailItem object.
The problem is - if the MailItem is changed, but is being deleted, I'm
displaying the "do you want to save changes" dialog anyway, because I
don't know that it's being deleted.
I'm using VB6 and developing for OL2000
The code looks somewhat like this:
Private Sub m_objMail_Close(Cancel As Boolean)
Dim iRetVal As Integer
If m_objMail.Saved = False Then
'Here I would like to know if m_objMail is being deleted
iRetVal = MsgBox("Save changes?", vbYesNoCancel)
Select Case iRetVal
Case vbYes
m_objInsp.Close olSave
Case vbNo
m_objInsp.Close olDiscard
Case vbCancel
Cancel = True
End Select
Else
m_objInsp.Close olDiscard
End If
End Sub
TIA,
Karls