|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Outlook VBA forward mail code - worked in Outlook 2007, but won't work in Outlook 2010
The code below forwards all my Outlook mails til my gmail account. It worked perfectly with Outlook 2007. Recently, my work computer was upgraded to Outlook 2010. Now the mails are not forwarded, nothing happens. I have activated macros in the settings, I receive no error messages.
Any tips on what might be the issue? The code in "This Outlook Session" module: Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) Dim varEntryID As Variant Dim objForwardedItem As MailItem Dim objOriginalItem As MailItem Dim newMail As MailItem On Error Resume Next For Each varEntryID In Split(EntryIDCollection, ",") 'denne under lagt til Set objOriginalItem = Application.GetNamespace("MAPI").GetItemFromID(var EntryID) 'det er denne som henter originalsender adresse....ser det ut til... Set newMail = CreateItem(olMailItem) With newMail .To = "MYMAIL@gmail.com" .Attachments.Add objOriginalItem .Subject = "" & objOriginalItem.SenderName & ": " & objOriginalItem.Subject '" EE" 'få inn originalavsender i subject .Display .Send End With Next End Sub |
#2
|
|||
|
|||
"Problem" solved: Outlook needed a restart, then the code worked as before!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2010 VBScript - error: forward a custom form | Berg | Outlook | 0 | 08-31-2015 10:10 AM |
Outlook 2010 worked on web not not on PC | Councillor | Outlook | 0 | 05-13-2015 06:41 PM |
Desktop outlook 2010 move my evert forward 10 hours | smilepolice | Outlook | 1 | 05-21-2012 09:15 PM |
Outlook 2010 Forward using default account | donna74 | Outlook | 0 | 02-16-2011 05:47 PM |
Insert table button doesn't work in Outlook 2010 e-mail message | ironwoods | Outlook | 0 | 08-02-2010 12:24 PM |