Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2016, 08:45 PM
perola.rike perola.rike is offline Outlook VBA forward mail code - worked in Outlook 2007, but won't work in Outlook 2010 Windows 7 32bit Outlook VBA forward mail code - worked in Outlook 2007, but won't work in Outlook 2010 Office 2007
Novice
Outlook VBA forward mail code - worked in Outlook 2007, but won't work in Outlook 2010
 
Join Date: Feb 2016
Posts: 5
perola.rike is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 06-02-2016, 07:45 PM
perola.rike perola.rike is offline Outlook VBA forward mail code - worked in Outlook 2007, but won't work in Outlook 2010 Windows 7 32bit Outlook VBA forward mail code - worked in Outlook 2007, but won't work in Outlook 2010 Office 2007
Novice
Outlook VBA forward mail code - worked in Outlook 2007, but won't work in Outlook 2010
 
Join Date: Feb 2016
Posts: 5
perola.rike is on a distinguished road
Default

"Problem" solved: Outlook needed a restart, then the code worked as before!
Reply With Quote
Reply

Thread Tools
Display Modes


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
Outlook VBA forward mail code - worked in Outlook 2007, but won't work in Outlook 2010 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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft