View Single Post
  #2  
Old August 1st 09, 06:20 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default A code that adds category to an outgoing mail message in outlook

There's no reason I can see for subject to become blank.

If this is running in the Outlook VBA project use Application and don't ever
use CreateObject or New:

If Not Application.ActiveInspector Is Nothing Then

etc.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"newED" wrote in message
...

This code adds a category name to an outgoing mail message in outlook.
However when using it - the subject disappears. Do you happen to know
why and how to fix it ?

Public Sub TagMessage()
Set objOL = CreateObject("Outlook.Application")
If Not objOL.ActiveInspector Is Nothing Then
Set objItem = objOL.ActiveInspector.CurrentItem
objItem.Categories = "my category"
End If
End Sub

Thanks for your help


--
newED
------------------------------------------------------------------------
newED's Profile: http://www.thecodecage.com/forumz/member.php?userid=603
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=121671


Ads