categories for Mail Message

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

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
 
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
 
Back
Top