changing FW: on forward

Status
Not open for further replies.

rinu

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Office 365 Exchange
Hi All,

I am new to VBA so any help will be greatly appreciated . I have to forward a mail from specific subject but need to get rid of FW: from the subject along with the signature and old users subject, emails...etc.

how do i do it ?

Regards
Roma
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
i have samples here Run a Script Rule: Change Subject then Forward Message

changing the subject and removing the forward header and your signature is a piece of cake, removing the original sender's signature is more difficult, especially if they don't use a signature separator - you need to know where to split it.
 

rinu

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Office 365 Exchange
Hi Diane,
I was able to get it work with the below code. But it seems to be messing up the formating. After running the below code all the Rich text content seems to be missing from the body.

Sub RemoveExpression()

Dim Insp As Inspector
Dim obj As Object
Dim subStr As String
Dim oMail As MailItem
Dim itmOld As MailItem, itmNew As MailItem
Set Insp = Application.ActiveInspector
Set oMail = Insp.CurrentItem

lPosition = InStr(oMail.Body, "Subject: ") - 1
' obj.Subject = Mid(oMail.Subject, 5)
subStr = Left(oMail.Body, lPosition)
oMail.Body = Replace(oMail.Body, subStr, "")
oMail.Subject = Replace(oMail.Subject, "FW:", "")

'obj.Body = Replace(obj.HTMLBody, "abc", "")
Set obj = Nothing
Set Insp = Nothing
End Sub
 

rinu

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Office 365 Exchange
I did it with the below code
Sub RemoveExpression()
Dim Insp As Inspector
Dim subStr As String
Dim oMail As MailItem
Dim itmOld As MailItem, itmNew As MailItem
Set Insp = Application.ActiveInspector
Set oMail = Insp.CurrentItem
lPosition = InStr(oMail.HTMLBody, "Subject:") + 7 + (Len(oMail.Subject)) + 1
subStr = Left(oMail.HTMLBody, lPosition)
oMail.HTMLBody = Replace(oMail.HTMLBody, subStr, "")
oMail.Subject = Replace(oMail.Subject, "FW:", "")
Set obj = Nothing
Set Insp = Nothing
End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
T Changing Sent Items location in Outlook 2019 Using Outlook 0
E Outlook view grouping keeps changing Using Outlook 3
B BCC issues after changing root folder path for gmail Using Outlook 1
M Changing the preferred order for "Put this entry in" list for adding new contacts to the Address Book Using Outlook 1
J Outlook 2010 Changing events in Outlook calendar via opening file, importing CSV Using Outlook 0
A .restrict results changing after moving to Exchange online Outlook VBA and Custom Forms 0
T Outlook Contacts ... Changing Font Size, Style, Bold, etc. Using Outlook 2
N Rule for "on behalf of" - with changing names Using Outlook 2
O Save attachments using hotkey without changing attributes Outlook VBA and Custom Forms 1
M Outlook 2016: Changing default font for Notes and Reading Pane Using Outlook 4
V Changing default date for task follow-up buttons Using Outlook 2
Gary Hile Outlook 2016 changing editor options Using Outlook 6
J Outlook Rules - Changing auto-submit address in multiple rules, according to rule name Outlook VBA and Custom Forms 0
S Problems syncing emails with webmail after changing to Outlook 2016 Using Outlook 1
T Changing default Mail Account in Outlook 2016 - POP3 Using Outlook 1
S Changing notification sound for new incoming messages in Outlook 365/2016 Using Outlook 1
Stephen Weinberg Changing the mailing address checkbox Using Outlook 0
D Outlook 2013 changing iCloud reminder time? Using Outlook 0
C Changing the name of Outlook Messages saved to a folder Using Outlook 1
A Outlook.com changing appointments Using Outlook 8
B Changing CC list to .add Outlook VBA and Custom Forms 2
Diane Poremsky Changing the Message Size in Exchange Server New Slipstick.com Articles 0
B changing Win7 default backup schedule for Previous Versions Using Outlook 0
Diane Poremsky Changing the default *.pst and *.ost sizes New Slipstick.com Articles 0
P Message Class keeps changing back to IPM.Contact Outlook VBA and Custom Forms 2
C Macro to send email after changing from address and adding signature Outlook VBA and Custom Forms 1
Diane Poremsky Changing Outlook.com color schemes New Slipstick.com Articles 0
R Outlook calendar appointments Free/Busy time is changing from "Busy" to "Free" Using Outlook 2
W Changing looks of emails in Outlook 2003 Using Outlook 0
L Office 365 Outlook changing default contact folder Using Outlook 0
Diane Poremsky Changing the From Domain in Office 365 New Slipstick.com Articles 0
R The changing way to access information in Office 365 New Slipstick.com Articles 0
N Creating or changing the main new mail message template in Outlook 2010 Using Outlook 2
T issue changing [Type] in dbo.ContactMainTable/ contacts seem to be deleted BCM (Business Contact Manager) 5
William Yeack Outlook/Exchange - Changing display of “From” user Using Outlook 3
divan VbaProject: Changing email format Using Outlook 15
C Changing Domain -- Assigned To User field Migration? BCM (Business Contact Manager) 1
M CHANGING ACCOUNT NAME Using Outlook 0
J Changing margins in received email display Using Outlook 3
B Automatic picture download and changing email addresses Using Outlook 3
L changing view settings based on message body Using Outlook 1
M How to automatically refresh an appointment windows after changing the MessageClass property ? Outlook VBA and Custom Forms 4
J Changing Contact Notes Font Outlook VBA and Custom Forms 9
cimbian Changing default contact view Using Outlook 2
S Outlook custom checkbox not changing value Using Outlook 0
E Changing layout of forms in BCM Using Outlook 1
P Changing from POP to IMAP; will this setup work? Using Outlook 1
V View zoom setting changing Using Outlook 1
B New hosting server & changing IMAP accounts Using Outlook 2
S Auto Complete incorrect after changing an email address Using Outlook 3

Similar threads

Top