\r\n\r\n
Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > Outlook Macro - Remove FW: from Subject Lines


\r\n \r\n
 
 
Thread Tools Display Modes

\r\n\r\n\r\n
I\'m trying to build a macro to remove the FW: from the subject line for selected emails. The code runs through but doesn\'t alter the subject line.
\r\n
\r\nI can\'t figure out why
\r\n
\r\n
\r\n
Code:
\r\n
Sub SubjectFix()\r\n\r\nOn Error Resume Next\r\n    Dim objFolder As Outlook.MAPIFolder\r\n    Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem\r\n    Dim folderID As String\r\n    \r\n     Set objNS = Application.GetNamespace("MAPI")\r\n\r\nFor Each objItem In Application.ActiveExplorer.Selection\r\n   \'If objFolder.DefaultItemType = olMailItem Then\r\n      If objItem.Subject = "FW: blah blah blah" Then\r\n         objItem.Subject = "blah blah blah"\r\n      End If\r\nNext\r\n\r\nEnd Sub
\r\n
\r\n \r\n\r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[1392067] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 03-29-2012, 06:54 AM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n jcleary47\r\n jcleary47 is offline\r\n\r\n\r\n
Prev Previous Post   Next Post Next
  #1  
Old 03-29-2012, 06:48 AM
jcleary47 jcleary47 is offline
Newcomer
 
Join Date: May 2008
Posts: 24
Default Outlook Macro - Remove FW: from Subject Lines


I'm trying to build a macro to remove the FW: from the subject line for selected emails. The code runs through but doesn't alter the subject line.

I can't figure out why

Code:
Sub SubjectFix()

On Error Resume Next
    Dim objFolder As Outlook.MAPIFolder
    Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem
    Dim folderID As String
    
     Set objNS = Application.GetNamespace("MAPI")

For Each objItem In Application.ActiveExplorer.Selection
   'If objFolder.DefaultItemType = olMailItem Then
      If objItem.Subject = "FW: blah blah blah" Then
         objItem.Subject = "blah blah blah"
      End If
Next

End Sub
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->