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
|Instructions on how to open shared calendar within Mac Outlook 2016||2||41|
|I need help embedding an image as HTML in my vb.net application||3||50|
|vba code in excel to save the current open mail item as .msg or .oft file in a location||23||62|
|Outlook 2016: The message store has reached its maximum size.||5||11|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
23 Experts available now in Live!