Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / January 2005

Tip: Looking for answers? Try searching our database.

categories for Mail Message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 07 Jan 2005 21:54 GMT
Is there any way to apply categories to a message before
it is sent? Using VBA, dialogs or userforms to select the
categories from the master categories.

Context: After it is sent and defaulted to sent file, we
can apply a category for search on it later.

Alternatively if it cannot be tagged when being sent, is
there a class event that can fire when a message is saved
to sent folder, and then have a useform offer up a
category option and the abilty to save the message in a
choice of folders.

Dave
Michael Bauer - 09 Jan 2005 16:58 GMT
Hi Dave,

> Is there any way to apply categories to a message before
> it is sent?

yes it is, e.g.:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
 If TypeOf Item Is Outlook.MailItem Then
   AddCategories Item
 End If
End Sub

Private Sub AddCategories(oMail As Outlook.MailItem)
 Select Case Len(oMail.Categories)
 Case Is > 0
   oMail.Categories = oMail.Categories & "; any cat"
 Case Else
   oMail.Categories = "any cat"
 End Select
End Sub

> ... Using VBA, dialogs or userforms to select the
> categories from the master categories.

In OL 2003 there is the MailItem.ShowCategoriesDialog (also in OL XP, I
suppose).

For OL2k you would need to build your own dialog and read the registry
for the masterlist. This can´t be done with VBA directly, instead you
can use the Win32 API. Keywords for you are RegOpenKeyEx,
RegQueryValueEX and some others.

Samples may be available at: http://www.mentalis.org
A very extensive (and german) project/source code is available at:
http://www.gssg.de/tips.htm#kb_regt

Signature

Viele Grüße
Michael Bauer

> Is there any way to apply categories to a message before
> it is sent? Using VBA, dialogs or userforms to select the
[quoted text clipped - 10 lines]
>
> Dave
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.