![]() |
| 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. |
|
|||||||
| Tags: adding, category, email, programmatically |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
just trying to create some code that responds to a Msgbox prompt when the Outlook ItemSend event is fired. My code is below and it all works fine except for the piece where I try to assign a category to the email. If a user chooses Yes in the msgbox, I want the email to be forwarded to the Records department(this works) and for the email to be assigned a category of registered(this doesn't). Any help appreciated with this seemingly simple task. Cheers, Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim str1 As String Dim str2 As String Dim myvar str1 = "Would you like to register this email?" str2 = "Records Management" myvar = MsgBox(str1, vbYesNo, str2) If myvar = 6 Then Item.Categories = "Registered" Item.Save Set myRecip = ") myRecip.Type = olBCC Item.Recipients.ResolveAll End If End Sub |
| Ads |
|
#2
|
|||
|
|||
|
Sorry,
I need to correct the below. I need to be able to make the Categories that are added in this process appear at the receiver's end. The below code only affects the categories of the item on the local machine, ie. in the Sent Items folder. Any ideas? Cheers, hepadmin wrote: Hi, just trying to create some code that responds to a Msgbox prompt when the Outlook ItemSend event is fired. My code is below and it all works fine except for the piece where I try to assign a category to the email. If a user chooses Yes in the msgbox, I want the email to be forwarded to the Records department(this works) and for the email to be assigned a category of registered(this doesn't). Any help appreciated with this seemingly simple task. Cheers, Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim str1 As String Dim str2 As String Dim myvar str1 = "Would you like to register this email?" str2 = "Records Management" myvar = MsgBox(str1, vbYesNo, str2) If myvar = 6 Then Item.Categories = "Registered" Item.Save Set myRecip = ") myRecip.Type = olBCC Item.Recipients.ResolveAll End If End Sub |
|
#3
|
|||
|
|||
|
I think the receiver has a rule or somthing else running that deletes categories of incoming messages. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Keep your Outlook categories organized! http://www.shareit.com/product.html?...4&languageid=1 (German: http://www.VBOffice.net/product.html?pub=6) Am 16 Jan 2007 17:31:02 -0800 schrieb hepadmin: Sorry, I need to correct the below. I need to be able to make the Categories that are added in this process appear at the receiver's end. The below code only affects the categories of the item on the local machine, ie. in the Sent Items folder. Any ideas? Cheers, hepadmin wrote: Hi, just trying to create some code that responds to a Msgbox prompt when the Outlook ItemSend event is fired. My code is below and it all works fine except for the piece where I try to assign a category to the email. If a user chooses Yes in the msgbox, I want the email to be forwarded to the Records department(this works) and for the email to be assigned a category of registered(this doesn't). Any help appreciated with this seemingly simple task. Cheers, Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim str1 As String Dim str2 As String Dim myvar str1 = "Would you like to register this email?" str2 = "Records Management" myvar = MsgBox(str1, vbYesNo, str2) If myvar = 6 Then Item.Categories = "Registered" Item.Save Set myRecip = ") myRecip.Type = olBCC Item.Recipients.ResolveAll End If End Sub |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problems while adding new Category in Outlook 2007 | Ahmed Al-Lakani | Add-ins for Outlook | 1 | September 10th 06 01:55 PM |
| Programmatically sending email from Access | scariharry | Outlook and VBA | 0 | July 5th 06 06:08 PM |
| How to programmatically save all email attachments in a folder | Brian Beck | Outlook and VBA | 1 | April 20th 06 03:47 PM |
| How to differ between received and sent email programmatically | Darius | Add-ins for Outlook | 3 | April 6th 06 09:06 PM |
| Adding information to columns in "Category" view | emlawpro | Outlook - Using Contacts | 3 | March 18th 06 03:12 AM |