Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-03-2016, 07:36 AM
perola.rike perola.rike is offline VBA forward to gmail - include original subject Windows 7 32bit VBA forward to gmail - include original subject Office 2007
Novice
VBA forward to gmail - include original subject
 
Join Date: Feb 2016
Posts: 5
perola.rike is on a distinguished road
Default VBA forward to gmail - include original subject

I have this code that perfectly forwards all my outlook mails to gmail. Only one thing is missing: In gmail, there is "no subject". Can anyone help me modify the code below to include the original subject in the forwarded mail?

In "this outlook session":

Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim varEntryID As Variant
Dim objOriginalItem As MailItem
Dim newMail As MailItem

For Each varEntryID In Split(EntryIDCollection, ",")
Set objOriginalItem = Application.GetNamespace("MAPI").GetItemFromID(var EntryID)

Do Until objOriginalItem.Attachments.Count = 0
objOriginalItem.Attachments.Remove (1)
Loop

Set newMail = CreateItem(olMailItem)

With newMail

.To = "MYMAILHERE@gmail.com"
.Subject
.Attachments.Add objOriginalItem
.Display

.Send
End With


Next

ExitRoutine:


Set objOriginalItem = Nothing
Set newMail = Nothing

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA forward to gmail - include original subject Auto-forward HTML emails with added suffix to subject line paulkaye Outlook 18 01-24-2016 11:42 PM
VBA rule to forward messages from specific folder and forward Bursal Outlook 16 09-23-2015 04:09 AM
Change subject to include date and time in subject officechris Outlook 1 05-01-2015 09:58 PM
Need to forward subject alone of mails abhikulsh Outlook 1 08-28-2013 10:47 AM
Using a rule: How do I include a copy of the original e-mail message when sending an Emerogork Outlook 0 04-09-2012 07:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:49 PM.


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