The following macro deletes the email address from the first email area. What can I change to delete from the email2 address, and also, the email3 address?
Sub DeleteEmail1()
Dim objApp As Application
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Dim objItem As Object
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
On Error Resume Next
If TypeName(objApp.ActiveWindow) = "Inspector" Then
Set objItem = objApp.ActiveInspector.currentItem
objItem.UserProperties("E-mail") = ""
objItem.Save
GoTo Leave
End If
Set objSelection = objApp.ActiveExplorer.Selection
For Each objItem In objSelection
objItem.UserProperties("E-mail") = ""
objItem.Save
Next
Leave:
Set objItem = Nothing
Set objFolder = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Sub
Sub DeleteEmail1()
Dim objApp As Application
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Dim objItem As Object
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
On Error Resume Next
If TypeName(objApp.ActiveWindow) = "Inspector" Then
Set objItem = objApp.ActiveInspector.currentItem
objItem.UserProperties("E-mail") = ""
objItem.Save
GoTo Leave
End If
Set objSelection = objApp.ActiveExplorer.Selection
For Each objItem In objSelection
objItem.UserProperties("E-mail") = ""
objItem.Save
Next
Leave:
Set objItem = Nothing
Set objFolder = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Sub