![]() |
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
|
|||
|
|||
![]()
I am setting a custom property via a button click event, which I try to read
in Item_send. This works for fine mail items (IPM.Note). But it does NOT work for MeetingRequests. The property gets set successfully by SetProperty method (it is visible via OutlookSpy). But it cannot be found when trying to read via "GetProperty" method from within Item_Send event. Any ideas would be appreciated. TIA. Here is the relavent part of the code: ---------------------- OnbtnMyButton(ByVal control As Office.IRibbonControl, ByVal isPressed As Boolean) Dim objApp As Microsoft.Office.Interop.Outlook.Application Dim objInsp As Microsoft.Office.Interop.Outlook.Inspector Dim objItem As Object Dim objPA As Microsoft.Office.Interop.Outlook.PropertyAccessor Dim strPropSchema As String = "http://schemas.microsoft.com/mapi/string/{2516bae8-2064-4d58-9dc3-6cdd1058f8d1}/ButtonState" objApp = Globals.ThisAddIn.Application objInsp = objApp.ActiveInspector objItem = objInsp.CurrentItem objPA = objItem.PropertyAccessor If isPressed Then objPA.SetProperty(strPropSchema, "Pressed") Else objPA.SetProperty(strPropSchema, "UnPressed") End If objPA = Nothing objItem = Nothing objInsp = Nothing objApp = Nothing End Sub Private Sub oL_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean) Handles oL.ItemSend Dim objPA As Microsoft.Office.Interop.Outlook.PropertyAccessor Dim strPropSchema As String = "http://schemas.microsoft.com/mapi/string/{2516bae8-2064-4d58-9dc3-6cdd1058f8d1}/ButtonState" Dim strButtonState As String objPA = Item.PropertyAccessor '**** The following line does not work for MeetingRequests '**** (property cannot be found)**** strButtonState = objPA.GetProperty(strPropSchema) If strButtonState = "Pressed" Then ' Do my stuff End If objPA= nothing End Sub |
#2
|
|||
|
|||
![]()
Did some more testing ..
Looks like a Meeting request starts out with the messageclass "IPM.Appointment" but it changes to "IPM.Schedule.Meeting.Request" by the time the Item_send event fires. Perhaps Outlook does a conversion of some sort and Custom Properties get "dropped" in the process? Is there a way to get them to carry over? By the way, utilizing a User property (which do carry over) instead of a Custom property is not a viable option for me since they happen to print on Print-outs .. ! |
#3
|
|||
|
|||
![]()
Try using the GUID for PS_PUBLIC_STRINGS
("{00020329-0000-0000-C000-000000000046}") instead of your own custom GUID, see if that helps. -- 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 "Upul Samaranayake" wrote in message ... I am setting a custom property via a button click event, which I try to read in Item_send. This works for fine mail items (IPM.Note). But it does NOT work for MeetingRequests. The property gets set successfully by SetProperty method (it is visible via OutlookSpy). But it cannot be found when trying to read via "GetProperty" method from within Item_Send event. Any ideas would be appreciated. TIA. Here is the relavent part of the code: ---------------------- OnbtnMyButton(ByVal control As Office.IRibbonControl, ByVal isPressed As Boolean) Dim objApp As Microsoft.Office.Interop.Outlook.Application Dim objInsp As Microsoft.Office.Interop.Outlook.Inspector Dim objItem As Object Dim objPA As Microsoft.Office.Interop.Outlook.PropertyAccessor Dim strPropSchema As String = "http://schemas.microsoft.com/mapi/string/{2516bae8-2064-4d58-9dc3-6cdd1058f8d1}/ButtonState" objApp = Globals.ThisAddIn.Application objInsp = objApp.ActiveInspector objItem = objInsp.CurrentItem objPA = objItem.PropertyAccessor If isPressed Then objPA.SetProperty(strPropSchema, "Pressed") Else objPA.SetProperty(strPropSchema, "UnPressed") End If objPA = Nothing objItem = Nothing objInsp = Nothing objApp = Nothing End Sub Private Sub oL_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean) Handles oL.ItemSend Dim objPA As Microsoft.Office.Interop.Outlook.PropertyAccessor Dim strPropSchema As String = "http://schemas.microsoft.com/mapi/string/{2516bae8-2064-4d58-9dc3-6cdd1058f8d1}/ButtonState" Dim strButtonState As String objPA = Item.PropertyAccessor '**** The following line does not work for MeetingRequests '**** (property cannot be found)**** strButtonState = objPA.GetProperty(strPropSchema) If strButtonState = "Pressed" Then ' Do my stuff End If objPA= nothing End Sub |
#4
|
|||
|
|||
![]()
Ken,
Thanks a lot for the feedback. Changing the GUID did not resolve the issue. Here is what I found. As I had mentioned in a follow up post, when a user schedules a Meeting (ie: an Appointment item) and clicks "send", Outlook generates a "Meeting.request" item. In doing so, it does not transfer any custom properties present in the Appointment item. What fires the Send event is the Meeting Request, not the Appointment. What I ended up doing is implement the following logic in the item_send event: If the messageclass is a meeting.request AND Application.ActiveInspector.CurrentItem has a messageclass of "ipm.Appointment", Then Look for my custom property in the ActiveInspector.CurrentItem. In all other cases look for it in the item that fired the send event. Tested scenarios such as accepting, forwarding the meeting.. so far so good. Thanks again. Upul "Ken Slovak - [MVP - Outlook]" wrote: Try using the GUID for PS_PUBLIC_STRINGS ("{00020329-0000-0000-C000-000000000046}") instead of your own custom GUID, see if that helps. -- 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 "Upul Samaranayake" wrote in message ... I am setting a custom property via a button click event, which I try to read in Item_send. This works for fine mail items (IPM.Note). But it does NOT work for MeetingRequests. The property gets set successfully by SetProperty method (it is visible via OutlookSpy). But it cannot be found when trying to read via "GetProperty" method from within Item_Send event. Any ideas would be appreciated. TIA. Here is the relavent part of the code: ---------------------- OnbtnMyButton(ByVal control As Office.IRibbonControl, ByVal isPressed As Boolean) Dim objApp As Microsoft.Office.Interop.Outlook.Application Dim objInsp As Microsoft.Office.Interop.Outlook.Inspector Dim objItem As Object Dim objPA As Microsoft.Office.Interop.Outlook.PropertyAccessor Dim strPropSchema As String = "http://schemas.microsoft.com/mapi/string/{2516bae8-2064-4d58-9dc3-6cdd1058f8d1}/ButtonState" objApp = Globals.ThisAddIn.Application objInsp = objApp.ActiveInspector objItem = objInsp.CurrentItem objPA = objItem.PropertyAccessor If isPressed Then objPA.SetProperty(strPropSchema, "Pressed") Else objPA.SetProperty(strPropSchema, "UnPressed") End If objPA = Nothing objItem = Nothing objInsp = Nothing objApp = Nothing End Sub Private Sub oL_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean) Handles oL.ItemSend Dim objPA As Microsoft.Office.Interop.Outlook.PropertyAccessor Dim strPropSchema As String = "http://schemas.microsoft.com/mapi/string/{2516bae8-2064-4d58-9dc3-6cdd1058f8d1}/ButtonState" Dim strButtonState As String objPA = Item.PropertyAccessor '**** The following line does not work for MeetingRequests '**** (property cannot be found)**** strButtonState = objPA.GetProperty(strPropSchema) If strButtonState = "Pressed" Then ' Do my stuff End If objPA= nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
mark property read receipt = .t. | JimSturtz | Outlook - Using Contacts | 0 | March 17th 08 07:04 PM |
Ability to select one of several meetings in a single meetingrequest? | [email protected] | Outlook - Calandaring | 2 | January 31st 08 02:29 PM |
Meetingrequest not shown in calendar untill request has been read | shellyspradley | Outlook - Calandaring | 1 | May 31st 07 02:50 AM |
PropertyAccessor.GetProperty | Peter Marchert | Outlook and VBA | 4 | January 10th 07 09:14 PM |
Change Read Only Property on Forward | [email protected] | Outlook - Using Forms | 1 | July 19th 06 10:39 PM |