martindixon
04-01-2014, 11:14 AM
I have two separate macros that I would like to join together but have no idea how to do it.
The first is to auto populate the date and name before the subject text. The second one when you click on send comes up with a box asking if you would like to send as encrypted, if yes is selected it puts encrypt at the start of the subject. if no is clicked then still have the date at the start.
Private Sub Application_ItemSend(ByVal ITEM As Object, Cancel As Boolean)
If Left(ITEM.Subject, 4) = Format(Now(), "yyyymm") Or Left(ITEM.Subject, 3) = "FW:" Or Left(ITEM.Subject, 3) = "RE:" Then
Else
ITEM.Subject = Format(Now(), "yyyymmdd-") & “ME" & Replace(ITEM.Subject, " ", "_")
End If
End Sub
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
dim msg as string
msg =
Select Case MsgBox("Would you like to Encrypt this message?", vbYesNoCancel + vbQuestion + vbMsgBoxSetForeground, Item.Subject)
Case Is = vbYes
Set olkMsg = Outlook.Application.ActiveInspector.CurrentItem
olkMsg.Subject = "encrypt" & olkMsg.Subject
Set olkMsg = Nothing
Case Is = vbNo
Cancel = False
Case Is = vbCancel
Cancel = True
End Select
End Sub
The first is to auto populate the date and name before the subject text. The second one when you click on send comes up with a box asking if you would like to send as encrypted, if yes is selected it puts encrypt at the start of the subject. if no is clicked then still have the date at the start.
Private Sub Application_ItemSend(ByVal ITEM As Object, Cancel As Boolean)
If Left(ITEM.Subject, 4) = Format(Now(), "yyyymm") Or Left(ITEM.Subject, 3) = "FW:" Or Left(ITEM.Subject, 3) = "RE:" Then
Else
ITEM.Subject = Format(Now(), "yyyymmdd-") & “ME" & Replace(ITEM.Subject, " ", "_")
End If
End Sub
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
dim msg as string
msg =
Select Case MsgBox("Would you like to Encrypt this message?", vbYesNoCancel + vbQuestion + vbMsgBoxSetForeground, Item.Subject)
Case Is = vbYes
Set olkMsg = Outlook.Application.ActiveInspector.CurrentItem
olkMsg.Subject = "encrypt" & olkMsg.Subject
Set olkMsg = Nothing
Case Is = vbNo
Cancel = False
Case Is = vbCancel
Cancel = True
End Select
End Sub