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
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
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