Outlook 2002 / Junk mail list

  • Thread starter Thread starter Donald
  • Start date Start date
D

Donald

Can someone give me a few clues to write a macro that will add a selected
email to the junk mail list then delete the same email? I'm familiar with
Excel VBA but never done any VBA with Outlook, so I'm not familiar with any
of the Outlook objects, methods, etc.
 
For versions prior to 2003, Outlook stores the list of blocked senders in
this file:

C:\Documents and Settings\user\Application Data\Microsoft\Outlook\Junk
Senders.txt

So all you need to do is append the e-mail address to this file. A good way
is to use the TextStream object from the Microsoft Scripting Runtime Library
(VBScript).

To get a handle to the selected e-mail, use the Explorer.Selection property.
For an open e-mail, use Inspector.CurrentItem. In both cases, get the value
of the MailItem.SenderEmailAddress. Note that accessing this property will
cause the security warning dialog to appear. See this link for more info:

Microsoft Outlook "Object Model Guard" Security Issues for Developers:
http://www.outlookcode.com/d/sec.htm
 
Hi Eric

Is there a way to do manage Blocked Senders in OL 2003?

That text file no longer exists & the Microsoft Office Outlook 2003 VBA
Language Reference doesn't seem to offer any help

thanks
 
Back
Top