M
Mark Rae
Hi,
I'm trying to write a macro to add the sender of the selected messages in my
Inbox to the Blocked Senders list. I'm able to add the messages to the Junk
E-mail folder, but that does not appear to add their senders into the
Blocked Senders list. Here's what I'm using:
Sub DeleteJunk()
Dim objOutlook As New Outlook.Application
Dim objExplorer As Outlook.Explorer
Dim objSelection As Outlook.Selection
Dim objJunkFolder As Outlook.MAPIFolder
Dim intMessage As Integer
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objInbox = objNameSpace.GetDefaultFolder(olFolderInbox)
Set objExplorer = objOutlook.ActiveExplorer
Set objSelection = objExplorer.Selection
Set objJunkFolder = objNameSpace.Folders("Personal Folders").Folders("Junk
E-mail")
For intMessage = 1 To objSelection.Count
' need to add sender to Blocked Senders list
objSelection.Item(intMessage).Move objJunkFolder
Next intMessage
End Sub
Any assistance gratefully received.
Best regards,
Mark Rae
I'm trying to write a macro to add the sender of the selected messages in my
Inbox to the Blocked Senders list. I'm able to add the messages to the Junk
E-mail folder, but that does not appear to add their senders into the
Blocked Senders list. Here's what I'm using:
Sub DeleteJunk()
Dim objOutlook As New Outlook.Application
Dim objExplorer As Outlook.Explorer
Dim objSelection As Outlook.Selection
Dim objJunkFolder As Outlook.MAPIFolder
Dim intMessage As Integer
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objInbox = objNameSpace.GetDefaultFolder(olFolderInbox)
Set objExplorer = objOutlook.ActiveExplorer
Set objSelection = objExplorer.Selection
Set objJunkFolder = objNameSpace.Folders("Personal Folders").Folders("Junk
E-mail")
For intMessage = 1 To objSelection.Count
' need to add sender to Blocked Senders list
objSelection.Item(intMessage).Move objJunkFolder
Next intMessage
End Sub
Any assistance gratefully received.
Best regards,
Mark Rae