![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
If you access Outlook through COM-automation and create a new MailItem,
you lose access to it when it is send. "The subject has been moved or deleted" or some such error message you get, if you try to access any of the mails properties after it has been send. I know i need to keep track of the MailItem where it is using MAPIFolder.Items.ItemAdd event on the "Sent Items" folder and add a unique custom property to the message and then search for that message in the "Sent Items" folder. I got the ItemAdd and it find it but i need to check it is the right message so how can i add a custom property to all the MailItem in outlook? Thanks Donald |
#2
|
|||
|
|||
![]()
You should be able to use the Application_ItemSend event handler to add a custom property.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "donald" wrote in message oups.com... If you access Outlook through COM-automation and create a new MailItem, you lose access to it when it is send. "The subject has been moved or deleted" or some such error message you get, if you try to access any of the mails properties after it has been send. I know i need to keep track of the MailItem where it is using MAPIFolder.Items.ItemAdd event on the "Sent Items" folder and add a unique custom property to the message and then search for that message in the "Sent Items" folder. I got the ItemAdd and it find it but i need to check it is the right message so how can i add a custom property to all the MailItem in outlook? Thanks Donald |
#3
|
|||
|
|||
![]()
I could do it with that yes but i would like to do it with ItemAdd
because i basic set it all up now. i am putting the custom property in side Mileage but i can't read what is in Mileage i get a error about late binding this is my code: Private Sub currentoutbox_ItemAdd(ByVal Item As Object) Handles currentoutbox.ItemAdd Dim subject As String Dim Mileage As String subject = Item.Subject Try Mileage = Item.Mileage Catch ex As Exception MsgBox(ex.ToString) End Try End Sub |
#4
|
|||
|
|||
![]()
Never, ever change items in the Outbox. Either change them in the Sent Items folder or use Application_ItemSend.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "donald" wrote in message oups.com... I could do it with that yes but i would like to do it with ItemAdd because i basic set it all up now. i am putting the custom property in side Mileage but i can't read what is in Mileage i get a error about late binding this is my code: Private Sub currentoutbox_ItemAdd(ByVal Item As Object) Handles currentoutbox.ItemAdd Dim subject As String Dim Mileage As String subject = Item.Subject Try Mileage = Item.Mileage Catch ex As Exception MsgBox(ex.ToString) End Try End Sub |
#5
|
|||
|
|||
![]()
i am chnaging that in the Sent Items
i have currentoutbox = _NameSpace.Folders.Item("MailBox - XXXXXXXXXX").Folders("Sent Items").Items |
#6
|
|||
|
|||
![]()
But you're using the Add event on the OUtbox's Items collection:
Private Sub currentoutbox_ItemAdd(ByVal Item As Object) Handles currentoutbox.ItemAdd Never use that folder's ItemAdd event. Use the ItemAdd event in Sent Items or use Application_ItemSend. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "donald" wrote in message ups.com... i am chnaging that in the Sent Items i have currentoutbox = _NameSpace.Folders.Item("MailBox - XXXXXXXXXX").Folders("Sent Items").Items |
#7
|
|||
|
|||
![]()
Application.ItemSend event fires before the mesasge is first moved to the
Outbox and then to the Sent Items folder, so you you can safely add your custom prop in that event handler. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "donald" wrote in message oups.com... If you access Outlook through COM-automation and create a new MailItem, you lose access to it when it is send. "The subject has been moved or deleted" or some such error message you get, if you try to access any of the mails properties after it has been send. I know i need to keep track of the MailItem where it is using MAPIFolder.Items.ItemAdd event on the "Sent Items" folder and add a unique custom property to the message and then search for that message in the "Sent Items" folder. I got the ItemAdd and it find it but i need to check it is the right message so how can i add a custom property to all the MailItem in outlook? Thanks Donald |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I set up Outlook for email without losing contacts | Lorraine | Outlook - General Queries | 3 | March 1st 06 03:37 PM |
How can I create a MailItem that displays like a received MailItem ? | Clive | Outlook - Using Forms | 0 | February 27th 06 05:14 PM |
Will Outlook Handle These Needs? | Janet | Outlook - Calandaring | 0 | February 17th 06 11:43 PM |
How can I Print out my contacts without losing longer note entrys | BBusyBookworm | Outlook - Using Contacts | 1 | February 15th 06 04:10 PM |
dialog comes up when trying to access mailItem | Neo | Add-ins for Outlook | 3 | January 16th 06 10:56 PM |