Lef_pl
10-12-2021, 07:07 AM
Hello,
I have a macro which starts before ItemSend.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim question As String
Dim strSubj As String
If TypeName(Item) = "MailItem" Then
strSubj = Item.Subject
Item.Display
If InStr(Item.Subject, "[Confidential]") > 0 Then
Exit Sub
Else '
question = MsgBox("Please do something", , "Attention")
MENU.Show
Cancel = True
End If
End If
End Sub
It works fine but when users keep several emails edited at once then after:
Menu.Show
Item.subject goes wrong.
For example:
I'm sending "Email1" with "Email2" and "Email3" being edited.
After Menu is shown the active email might be "Email2" instead of "Email1".
Could you please advise any workaround?
I have a macro which starts before ItemSend.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim question As String
Dim strSubj As String
If TypeName(Item) = "MailItem" Then
strSubj = Item.Subject
Item.Display
If InStr(Item.Subject, "[Confidential]") > 0 Then
Exit Sub
Else '
question = MsgBox("Please do something", , "Attention")
MENU.Show
Cancel = True
End If
End If
End Sub
It works fine but when users keep several emails edited at once then after:
Menu.Show
Item.subject goes wrong.
For example:
I'm sending "Email1" with "Email2" and "Email3" being edited.
After Menu is shown the active email might be "Email2" instead of "Email1".
Could you please advise any workaround?