- In Windows, create a certificate via Start > All Programs > Microsoft Office > Microsoft Office Tools > Digital Certificate for VBA Projects
- In Microsoft Outlook, open the VB editor and copy/paste the code below
- Replace your@email.here and save
- Click on Tools > Digital Signature
- Click on [Choose] and select your certificate
- Click OK, then save and close the VB editor
- Create the Outlook rule with [run a script] as action and select your macro
- That’s all folks !
Private Const TO_EMAIL As String = "your@email.here"
Sub ForwardAllEmail(theMail As MailItem)
On Error GoTo EndSub
Dim mailObj As Outlook.MailItem
Dim item As Outlook.MailItem
Set mailObj = Application.Session.GetItemFromID(theMail.EntryID)
Set item = mailObj.Forward
item.Recipients.Add (TO_EMAIL)
item.Send
Set item = Nothing ' Set variables to null to prevent memory leaks
Set mailObj = Nothing
Exit Sub
EndSub:
MsgBox "Error: " & Err.Description
End Sub
windows