Few questions about VBA in outlook -difficult.

R

RenaatLanduyt

I have two minor questions about outlook macro’s or VBA code:

1/
I have two mailboxes: one shared for my bureau, and one personal mailbox. I
almost never check the bureau-mailbox, but sometimes it contains important
mails.
I want to do the following: forward all the mails that are send to the
bureau-mailbox and NOT to my personal mailbox.
Note however that sometimes my address is a part of a group (eg. My mail
address is a member of “[email protected]â€).

How can I make such a code which runs automatically on every incoming mail?
Is it correct that this should be VBA code and not a macro?

We’re using MS-exchange, outlook 2003.

2/
I have a huge *.pst file with a entire tree of folders.
Some identical mails appear in different folders. This is OK.
Some identical mails also appear in the same folder. This is not OK.
I want to make code that searches in each folder and removes the duplicates
in the folder. The “cross-folder-duplicates†should not be removed.
I searched a lot already, because I supposed such a macro should be on the
internet, but I didn’t found any.

Thanks in advance.
 
E

Eric Legault [MVP - Outlook]

1) Create or open the Outlook profile that has a single account for your
bureau mailbox. Create a server-side Rule that forwards alll e-mails to your
other e-mail address. This way you don't have to write any code at all.

2) You'll have to loop through the Items collection for the folder
containing the duplicate e-mails. For each mail item you retrieve during the
loop, use the Restrict method with the Subject property where the matching
criteria is the value of the current message's Subject. This will give you a
set of e-mails that have the same subject. You can then loop through this
new Items collection to compare other properties to see if they are
duplicates e-mails. Take caution because a valid e-mail conversation thread
will have many e-mails with the same Subject value. If you do find
duplicates, delete them from the filtered Items collection. Note also that
you'll have to loop through any collection that you intend on deleting from
using this technique:

For intX = Items.Count To 1 Step -1

Next
 
R

RenaatLanduyt

Eric Legault said:
1) Create or open the Outlook profile that has a single account for your
bureau mailbox. Create a server-side Rule that forwards alll e-mails to your
other e-mail address. This way you don't have to write any code at all.
Thanks.
Stupid question I guess, but can I make server side rules? And, if so, how?
I'm only a normal user, not some kind of administrator...

When all those mails are forwarded, the mails which are sent to all
mauilusers will be twice in my mailbox. Correct?
 
E

Eric Legault [MVP - Outlook]

Yes, anybody can make server side rules if you are using an Exchange mailbox;
no special permissions are required. They are called that because they can
be processed when your Outlook is closed; those that need your Outlook to be
open are client side. Outlook will usually tell you when you have finished
creating the rule what kind it is - I believe it warns you if it's client
side.

And yes, I'm pretty sure if you forward an e-mail to a Distribution List
that also contains your address you will get yet another copy. This may
actually create a circular loop I'm thinking; make sure you enable the rule
that says "If sent directly to me".

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top