We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Private Sub olSentTrg_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim fldr As Outlook.MAPIFolder 'Step 1 'This is where the Regular Expression is challanged. Function ProcessString 'is trigger upon Sending. This will look at both the TO field and Subject Line 'to see if there are any 5 numeric characters or more - 3 numeric characters or more 'sequence. If this is true the next step is to see if the From field is blank If InStr(1, Item.To, "00000-000", 1) Or InStr(1, Item.To, "XXX Managers", 1) = True Then If Len(Item.SentOnBehalfOfName) = 0 Then If MsgBox("You are sending to a Distbuition Group and you did" & vbCrLf & _ "not fill in the From field with Managing Partner " & vbCrLf & vbCrLf & _ "Do you want to add Managing Partner" & vbCrLf & _ "to the From Field?", _ vbYesNo + vbExclamation) = vbYes Then Cancel = True Item.SentOnBehalfOfName = "Managing Partner" End If End If End If If Item.SentOnBehalfOfName = "Managing Partner" Then Set fldr = GetFolder("\\Mailbox - Smith\Sent Items\ManagerCopy") Set Item.SaveSentMessageFolder = fldr End If End Sub
If Item.SentOnBehalfOfName = "Managing Partner" Then Set fldr = GetFolder("\\Mailbox -Managing Partner\Sent Items") Set Item.SaveSentMessageFolder = fldr End If
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.