I'm hoping someone can help me. I have the following code in ThisOutlookSession
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
On Error Resume Next
prompt$ = "Do you want to flag this message for followup?"
If Item.Importance = olImportanceHigh Then
With Item
> MarkAsTask MarkThisWeek
> TaskDueDate = Now + 1
> Categories = "FOLLOW UP"
> UnRead = False
> Save
End With
Else
If MsgBox(prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Add flag?") = vbYes Then
With Item
> MarkAsTask MarkThisWeek
' sets a due date in 2 days
> TaskDueDate = Now + 2
> Categories = "FOLLOW UP"
> UnRead = False
> Save
End With
End If
End If
End Sub
It works beautifully. Now I want to add one more if statement dependant on who it is sent to. I added this...
If Item.SendTo = "email address" Then
With Item
> MarkAsTask MarkNextWeek
> TaskDueDate = Now + 10
> Categories = "NB FOLLOW UP"
> UnRead = False
> Save
End With
Nothing happens when I send the email...the popup box doesn't even come up. What am I missing/doing wrong?
Any help is appreciated.
Thanks!
Laura
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
On Error Resume Next
prompt$ = "Do you want to flag this message for followup?"
If Item.Importance = olImportanceHigh Then
With Item
> MarkAsTask MarkThisWeek
> TaskDueDate = Now + 1
> Categories = "FOLLOW UP"
> UnRead = False
> Save
End With
Else
If MsgBox(prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Add flag?") = vbYes Then
With Item
> MarkAsTask MarkThisWeek
' sets a due date in 2 days
> TaskDueDate = Now + 2
> Categories = "FOLLOW UP"
> UnRead = False
> Save
End With
End If
End If
End Sub
It works beautifully. Now I want to add one more if statement dependant on who it is sent to. I added this...
If Item.SendTo = "email address" Then
With Item
> MarkAsTask MarkNextWeek
> TaskDueDate = Now + 10
> Categories = "NB FOLLOW UP"
> UnRead = False
> Save
End With
Nothing happens when I send the email...the popup box doesn't even come up. What am I missing/doing wrong?
Any help is appreciated.
Thanks!
Laura