Re: Macro for using "Add Sender to Blocked Senders List" on multiple email messages simultaneously

From: Michael Bauer (mib00_at_t-online.de)
Date: 03/15/05


Date: Tue, 15 Mar 2005 17:16:58 +0100

Hi,

I suppose you didn´t understand me. What I wrote is a description of
what a macro could do, because there is no way for adding multiple
items´ sender addresses to the junk list directly.

Once, you´ve written the macro, you´d only need to select your items and
hit the button. The rest should be done by the macro. That is, it has to
be written first...

For all methods you can find easily code samples in the VBA help, here
are some keywords and code snippets:

1) Folders.Add

3-6)
Dim obj as Object
Dim YourFolderWithSelectedItems as Outlook.MapiFolder
Dim YourTemporaryFolder as Outlook.MapiFolder

' Your code: Set the references to the folders here

' Make the temporary folder the current one:
Set Application.ActiveExplorer.CurrentFolder = YourTemporaryFolder

For Each obj in YourFolderWithSelectedItems.Items
    obj.Copy YourTemporaryFolder
    ' Your code: Use the CommandBar technics now
    obj.Delete

-- 
Viele Grüße
Michael Bauer
"TJM" <tjm@nospam.com> wrote in message
news:39occpF638u1iU1@individual.net...
> That workaround is more tedious than my current method of clicking on
each spam
> message and hitting the "Add Sender to Blocked Senders List" button I
put on my
> Outlook toolbar.
>
> I like your idea of highlighting all my spam messages in my Inbox and
moving
> them to a temporary folder.  Then there should be a way to create a
macro that
> could sequentially add each message in that temp folder to my Blocked
Senders
> List.  Why is there no "Record New Macro" function in Outlook 2003
like there is
> in all the other Office apps?
>
>
> "Michael Bauer" <mib00@t-online.de> wrote in message
> news:O3CgEBTKFHA.2800@TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > please read "manipulating outlook 2003(not express) blocked
> > senders list with vba - macro" from 2004/03/17 in this NG. There
seems
> > to be no way.
> >
> > Because I don´t know a way for selecting items in a folder, here´s a
> > workaround:
> >
> > 1) Add a folder temporarily.
> > 2) Select all your mails for the junk filter.
> > 3) Walk through the selection and copy each item, one by one, to the
> > temporary folder.
> > 4) Use the commandbar technics
> > (http://www.outlookcode.com/d/tips/commandbarfun.htm) for adding the
> > sender address.
> > 5) Delete the hanled item from the temporary folder.
> > 6) Go back to step #3 until all addresses are added
> > 7) Delete the temporary folder (or keep it for the next time).
> >
> > In this way you could handle multiple items and the temporary folder
> > always contains only one item that then is the selected one.
> >
> > -- 
> > Viele Grüße
> > Michael Bauer
> >
> >
> > "TJM" <tjm@nospam.com> wrote in message
> > news:39mg10F63a9u4U1@individual.net...
> > > I have Outlook 2003 and use the "Add Sender to Blocked Senders
List"
> > command for
> > > all new spam emails.
> > >
> > > Since I get about 40-50 spams per day, it's quite tedious to hit
the
> > "Add Sender
> > > to Blocked Senders List" command on each & every spam email.  I
want
> > to be able
> > > to highlight all my spam messages in the Inbox window and click a
> > macro that
> > > will automatically add those spams to my Blocked Senders List.
Right
> > now, if I
> > > highlight on more than one message, the "Add Sender to Blocked
Senders
> > List"
> > > command is de-highlighted and wont function.....it can only
operate on
> > one email
> > > at a time.
> > >
> > > This seems like an easy macro to create, but I am not familiar
with
> > Visual Basic
> > > and dont know the first thing about creating a macro in Outlook
2003.
> > Can
> > > someone tell me how to create this macro, or post the code that
would
> > accomplish
> > > what I am trying to do?
> > >
> > >
> > >
> >
>
>