change subject and forward without FW:

Status
Not open for further replies.

Itroit

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
Hello,

I'm trying to make a simple rule in OL2016 that will process in outlook, identify certain emails and forward them to a specific address while changing the original subject without FW:

I have this script attached to a rule and it works but when it sends, it adds FW:

Sub ChangeSubjectThenSend()
Dim myolApp As Outlook.Application
Dim aItem As Object

Set myolApp = CreateObject("Outlook.Application")
Set mail = myolApp.ActiveExplorer.CurrentFolder

For Each aItem In mail.Items
aItem.Subject = "OATMEAL"
aItem.Save

Set myForward = aItem.Forward
myForward.Recipients.Add "repository@domain.com"
myForward.Send


Next aItem
End Sub

Any insight would be greatly appreciated!
 

Itroit

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
Thanks for taking the time Diane. Would below be correct in this case? I'm not sure how to edit to your description. Please advise.


Sub ChangeSubjectThenSend()
Dim myolApp As Outlook.Application
Dim aItem As Object

Set myolApp = CreateObject("Outlook.Application")
Set mail = myolApp.ActiveExplorer.CurrentFolder

For Each aItem In mail.Items
aItem.Subject = "OATMEAL"
aItem.Save

Set myForward = aItem.Forward
myForward.Recipients.Add "repository@domain.com"
myForward.subject = aitem.subject
myForward.Send


Next aItem
End Sub
 

Itroit

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
Wait, I think I got it... how's this? seems to work ;)


Sub ChangeSubjectThenSend()
Dim myolApp As Outlook.Application
Dim aItem As Object

Set myolApp = CreateObject("Outlook.Application")
Set mail = myolApp.ActiveExplorer.CurrentFolder

For Each aItem In mail.Items
aItem.Subject = "AMD"

Set myForward = aItem.Forward
myForward.Recipients.Add "poattachment@seanet.sea.local"
myForward.Subject = aItem.Subject
myForward.Send


Next aItem
End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
yes, that will work.

if you need to save the original item with the new subject, you may need to add aitem.save - if you only need to change the subject of the forward, you can use myforward.subject = "AMD" and remove the aitem.subject = "amd" line.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
J Auto Forward - Include Attachment and change Subject depending on original sender Outlook VBA and Custom Forms 3
V rule to Find some words in the subject, change subject then forward Using Outlook 1
M rule to change subject, pull email addresses from body, and forward with templ Using Outlook 14
J Change Outlook 2010 reply and forward subject prefixes? Using Outlook 2
A Edit subject - and change conversationTopic - using VBA and redemption Outlook VBA and Custom Forms 2
C Change Subject Line in Selected Emails Outlook VBA and Custom Forms 1
O On click,I want to change subject line of selected mail and then reply to particular email and move Using Outlook 3
E Button to change subject Outlook VBA and Custom Forms 1
Aussie I Change the Subject Line ... but after it is moved the subject has reverted Using Outlook 1
P Subject change on selected emails Outlook VBA and Custom Forms 14
A Change a subject after I hit send Using Outlook 1
F VBA Code to change subject Like Outlook VBA and Custom Forms 3
J Change Subject of 500 mails sitting in Outbox with Macro Using Outlook 6
P Automatically 'Reply to all', and Change the Subject of Email - Diane P help! Using Outlook 0
A Change subject line of external software using outlook. Using Outlook 1
L Script to: Change subject of email after checking body Using Outlook 2
J Change the subject line of messages in public folders Using Outlook 3
J Public folders woes (script to change subject line of messages) Exchange Server Administration 0
M Change font of from/to/subject block Using Outlook 1
C Change language of Out of Office (OOF) Subject Line in Exchange 2010 Exchange Server Administration 3
D Change subject of email Exchange Server Administration 2
P Calendar appointment subject change Using Outlook 3
J Outlook 2013 Change color of text in data fields of contacts in Outlook 2013? Using Outlook 3
B Change row background color of selected item Using Outlook 1
PGSystemTester VBA To Change AppointmentItem.BusyStatus From MeetingItem Before Send Using Outlook 0
B Change from Address Outlook VBA and Custom Forms 0
X If you change expiration date of repeated task it dupplicates Using Outlook 1
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1
B See "Change View" Drop Down as a List? Using Outlook 1
V Change start time based on message duration Outlook VBA and Custom Forms 2
R Folder pane width change Using Outlook 45
S Change VBA script to send HTML email instead of text Outlook VBA and Custom Forms 3
S Outlook 2010 unable to change default font Using Outlook 7
P How can I change my calendar view back Using Outlook 3
T Change the selected Message in the Outlook window Outlook VBA and Custom Forms 2
geofferyh How to change the Attachment File Name? Outlook VBA and Custom Forms 1
W Appointment occurrences change the location property Using Outlook 0
T Scheduled footer change Using Outlook 2
B Change font of reminder of an email header Outlook VBA and Custom Forms 3
CWM030 Name Change? Exchange Server Administration 9
V not able to change name in customize Ribbon Outlook VBA and Custom Forms 1
JoeG Appointment Delete/Change Recurrence Outlook VBA and Custom Forms 0
V Change default default save location to Quick Access Using Outlook 1
C Change default "Save Sent Item To" folder Outlook VBA and Custom Forms 9
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
B Do not change the From address in Outlook Templates Using Outlook 0
M Sudden change in From field - now very short Using Outlook 4
M cannot change delivery folders with IMAP accounts Using Outlook 0
S Email Format With Embedded Images and Tables Change Using Outlook 2
P Change PC User Directory & iPhone Sync Using Outlook 2
Similar threads


















































Top