I'm trying to follow the very similar request in this thread
/showthread.php?43155-Macro-for-sending-emails-to-give-classification-prefix-options-to-the-subject-line
but pasting the below code into ThisOutlookSession in VBA results in nothing occuring
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim frm As UserForm1
Dim chosenvalue As String
Set frm = New UserForm1
frm.Show vbModal
Select Case True
Case frm.OptionButton1.Value
chosenvalue = "PERSONAL"
Case frm.OptionButton2.Value
chosenvalue = "UNCLASSIFIED"
Case frm.OptionButton3.Value
chosenvalue = "CLASSIFIED"
Case Else ' no value chosen
MsgBox "you did not select a value. cancelling send."
Cancel = True
Exit Sub
End Select
If TypeName(Item) = "MailItem" Then
Item.Subject = Item.Subject & " [SEC=" & chosenvalue & "]"
End If
End Sub
Am I missing something obvious?