Windows 7, Outlook 2010 Exchange.
I have an autoforward macro for incoming email that works flawlessly in forwarding all incoming email items to an external account I need for consolidation.
The only issue is every time I cold boot and START Outlook, the items that appear after the usual "Updating this folder..." in the ticker do NOT autoforward. From that point forward the macro starts working perfectly again.
It is located in the ThisOutlookSession.
In previous Outlook versions, a rule that ran a similar macro always fired upon startup.
Thanks for any help.
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim varEntryIDs
Dim objItem
Dim myItem As MailItem
Dim i As Integer
varEntryIDs = Split(EntryIDCollection, ",")
For i = 0 To UBound(varEntryIDs)
Set objItem = Application.Session.GetItemFromID(varEntryIDs(i))
If TypeOf objItem Is MailItem Then
Set myItem = objItem.Forward
myItem.Recipients.Add "bcc.hwb@gmail.com"
myItem.DeleteAfterSubmit = True
myItem.Send
Set myItem = Nothing
Else
Debug.Print "Skipping " & TypeName(objItem)
Set myItem = Nothing
End If
Next
End Sub