H
hepadmin
Hi,
just trying to create some code that responds to a Msgbox prompt when
the Outlook ItemSend event is fired.
My code is below and it all works fine except for the piece where I try
to assign a category to the email. If a user chooses Yes in the
msgbox, I want the email to be forwarded to the Records department(this
works) and for the email to be assigned a category of registered(this
doesn't).
Any help appreciated with this seemingly simple task.
Cheers,
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
Dim str1 As String
Dim str2 As String
Dim myvar
str1 = "Would you like to register this email?"
str2 = "Records Management"
myvar = MsgBox(str1, vbYesNo, str2)
If myvar = 6 Then
Item.Categories = "Registered"
Item.Save
Set myRecip = Item.Recipients.Add("(e-mail address removed)")
myRecip.Type = olBCC
Item.Recipients.ResolveAll
End If
End Sub
just trying to create some code that responds to a Msgbox prompt when
the Outlook ItemSend event is fired.
My code is below and it all works fine except for the piece where I try
to assign a category to the email. If a user chooses Yes in the
msgbox, I want the email to be forwarded to the Records department(this
works) and for the email to be assigned a category of registered(this
doesn't).
Any help appreciated with this seemingly simple task.
Cheers,
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
Dim str1 As String
Dim str2 As String
Dim myvar
str1 = "Would you like to register this email?"
str2 = "Records Management"
myvar = MsgBox(str1, vbYesNo, str2)
If myvar = 6 Then
Item.Categories = "Registered"
Item.Save
Set myRecip = Item.Recipients.Add("(e-mail address removed)")
myRecip.Type = olBCC
Item.Recipients.ResolveAll
End If
End Sub