A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

A rule to file incoming mail in a public folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 12th 09, 04:45 PM posted to microsoft.public.outlook.program_vba
bluphoto[_2_]
external usenet poster
 
Posts: 1
Default A rule to file incoming mail in a public folder


Whenever I get an email from a client I want to be able to automatically
file a copy of it in a particular public folder. That part I have
already managed, using standard outlook rules.

The next part is a little harder. As there are several people in my
team who might receive a particular message, I want all of them to run
the same rule - ie to file the email in the appropriate public folder.
BUT there's no point in Jim filing it if Barry has already received the
same email and has filed it already, so I need some VBA to copy to
public folder IF the mail isn't already there.

That part I'm stuck with!

Note that I'm using OL2003 as user (not admin) so can't install any
third party software - hence having to make something myself in VBA. I'm
not too familiar with OL VBA, but have done a fair bit in EXCEL VBA. I
guess the same principles apply, but I don't really know my way round
the OL object model.

thanks


--
bluphoto
http://forums.slipstick.com/

  #2  
Old August 12th 09, 08:31 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default A rule to file incoming mail in a public folder



You can use the ItemAdd event of the inbox for that. Note, the event won't
be fired if Outlook doesn't run while you receive the email.

This gives you a reference to the subfolder "abc" of "Public Folders":
Set Folder = Application.Session.Folders("Public Folders").Folders("abc")

To copy an item call its Copy function and pass a ref to the target folder.

You just need to decide how to identify whether the item already exists in
the public folder. Maybe you can search for the Subject and ReceivedTime
properties. See the Items.Find function for that.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 12 Aug 2009 10:45:45 -0400 schrieb bluphoto:

Whenever I get an email from a client I want to be able to automatically
file a copy of it in a particular public folder. That part I have
already managed, using standard outlook rules.

The next part is a little harder. As there are several people in my
team who might receive a particular message, I want all of them to run
the same rule - ie to file the email in the appropriate public folder.
BUT there's no point in Jim filing it if Barry has already received the
same email and has filed it already, so I need some VBA to copy to
public folder IF the mail isn't already there.

That part I'm stuck with!

Note that I'm using OL2003 as user (not admin) so can't install any
third party software - hence having to make something myself in VBA. I'm
not too familiar with OL VBA, but have done a fair bit in EXCEL VBA. I
guess the same principles apply, but I don't really know my way round
the OL object model.

thanks

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I copy incoming messages to a msg file using a rule? Tony Outlook and VBA 0 July 3rd 09 01:38 PM
Using a rule to have an incoming mail message setup a calendar eve Justin H Outlook - Calandaring 2 January 22nd 09 01:33 AM
Moving public contacts e-mail to public journal with rule mbn Outlook - Using Contacts 2 May 18th 07 06:59 PM
activate contact folder from public folder with "show this folder as email address book using a prf file Frankie K. Outlook - Using Contacts 7 July 25th 06 06:37 PM
Rule to Forward Incoming Mail Fails when item is itself a replied-to or forwarded e-mail Steven Bookman Outlook - General Queries 3 April 6th 06 10:41 PM


All times are GMT +1. The time now is 09:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.