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