|
|
|
date: Mon, 18 Aug 2008 13:12:29 +0430,
group: microsoft.public.vsnet.vstools.office
back
ItemSend cancelation harms mouse operations on Meeting
Hello,
I found that setting Cancel=True for meetings on ItemSend event, might harm
mouse operation (shrink or expand the meeting). On thise scenarios,
shrinking\expanding the meeting is saved only locally, and Outlook does not
send the updates.
Scenario:
========
0. disable the Addin (Loadbehavior=0; Add-incode in the next section)
1. create Meeting, send.
2. close OL, enable the addin, open OL.
3. go to Calendar, expand the meeting with the mouse, Outlook asks you
whether to send changes or not, answer Yes.
4. the Addin prevents the sending.
5. expand the meeting again
******
Result: OL does not ask you whether you'd like to send changes. It simply
stores it locally.
******
Addin Code:
==========
public class ThisAddIn
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
AddHandler Application.ItemSend, AddressOf Application_ItemSend2
End Sub
Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown
RemoveHandler Application.ItemSend, AddressOf Application_ItemSend2
End Sub
Public Sub Application_ItemSend2(ByVal Item As Object, ByRef Cancel As
Boolean)
Dim oAppt As Outlook.AppointmentItem
Dim oMeet As Outlook.MeetingItem
Try
oAppt = TryCast(Item, Outlook.AppointmentItem)
If oAppt Is Nothing Then
oMeet = TryCast(Item, Outlook.MeetingItem)
If oMeet IsNot Nothing Then
'Removing this line prevent the behavior:
oAppt = Item.GetAssociatedAppointment(False)
End If
End If
If oAppt IsNot Nothing Then
Cancel = True
End If
Catch ex As Exception
MsgBox("error! " + ex.ToString())
Finally
Try
Runtime.InteropServices.Marshal.ReleaseComObject(Item)
Runtime.InteropServices.Marshal.FinalReleaseComObject(oAppt)
Runtime.InteropServices.Marshal.FinalReleaseComObject(oMeet)
oAppt = Nothing
oMeet = Nothing
Catch ex As Exception
End Try
End Try
End Sub
End class
Note:
=====
1. The line which cause the problem, in my example, is:
oAppt = Item.GetAssociatedAppointment(False)
If I remove it - OL works fine, and alwayes asks about sending the changed
meeting.
It's probabaly just an example, and I guess that there are more operations
that'll cause similiar efect.
2. Opening the meeting and updating it - works fine.
Thanks in advanced.
Moshe
date: Mon, 18 Aug 2008 13:12:29 +0430
author: Moshe Malin am
Re: ItemSend cancelation harms mouse operations on Meeting
What happens if the line is:
oAppt = Item.GetAssociatedAppointment(True)
--
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
"Moshe Malin" <mmozzess@newsgroup.nospam> wrote in message
news:%23%23jbZ5QAJHA.4064@TK2MSFTNGP02.phx.gbl...
> Hello,
>
> I found that setting Cancel=True for meetings on ItemSend event, might
> harm mouse operation (shrink or expand the meeting). On thise scenarios,
> shrinking\expanding the meeting is saved only locally, and Outlook does
> not send the updates.
>
> Scenario:
> ========
> 0. disable the Addin (Loadbehavior=0; Add-incode in the next section)
> 1. create Meeting, send.
> 2. close OL, enable the addin, open OL.
> 3. go to Calendar, expand the meeting with the mouse, Outlook asks you
> whether to send changes or not, answer Yes.
> 4. the Addin prevents the sending.
> 5. expand the meeting again
> ******
> Result: OL does not ask you whether you'd like to send changes. It simply
> stores it locally.
> ******
>
> Addin Code:
> ==========
> public class ThisAddIn
>
> Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Startup
> AddHandler Application.ItemSend, AddressOf Application_ItemSend2
> End Sub
>
> Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Shutdown
> RemoveHandler Application.ItemSend, AddressOf Application_ItemSend2
> End Sub
>
> Public Sub Application_ItemSend2(ByVal Item As Object, ByRef Cancel As
> Boolean)
> Dim oAppt As Outlook.AppointmentItem
> Dim oMeet As Outlook.MeetingItem
> Try
> oAppt = TryCast(Item, Outlook.AppointmentItem)
> If oAppt Is Nothing Then
> oMeet = TryCast(Item, Outlook.MeetingItem)
> If oMeet IsNot Nothing Then
> 'Removing this line prevent the behavior:
> oAppt = Item.GetAssociatedAppointment(False)
> End If
> End If
> If oAppt IsNot Nothing Then
> Cancel = True
> End If
> Catch ex As Exception
> MsgBox("error! " + ex.ToString())
> Finally
> Try
> Runtime.InteropServices.Marshal.ReleaseComObject(Item)
>
> Runtime.InteropServices.Marshal.FinalReleaseComObject(oAppt)
>
> Runtime.InteropServices.Marshal.FinalReleaseComObject(oMeet)
> oAppt = Nothing
> oMeet = Nothing
> Catch ex As Exception
> End Try
> End Try
> End Sub
>
> End class
>
> Note:
> =====
> 1. The line which cause the problem, in my example, is:
> oAppt = Item.GetAssociatedAppointment(False)
> If I remove it - OL works fine, and alwayes asks about sending the changed
> meeting.
>
> It's probabaly just an example, and I guess that there are more operations
> that'll cause similiar efect.
>
> 2. Opening the meeting and updating it - works fine.
>
>
> Thanks in advanced.
> Moshe
>
>
>
>
>
>
date: Mon, 18 Aug 2008 09:06:38 -0400
author: Ken Slovak - [MVP - Outlook]
Re: ItemSend cancelation harms mouse operations on Meeting
The same, unfortunatlly.
"Ken Slovak - [MVP - Outlook]" wrote in message
news:OhFmDNTAJHA.4852@TK2MSFTNGP04.phx.gbl...
> What happens if the line is:
>
> oAppt = Item.GetAssociatedAppointment(True)
>
>
> --
> 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
>
>
> "Moshe Malin" <mmozzess@newsgroup.nospam> wrote in message
> news:%23%23jbZ5QAJHA.4064@TK2MSFTNGP02.phx.gbl...
>> Hello,
>>
>> I found that setting Cancel=True for meetings on ItemSend event, might
>> harm mouse operation (shrink or expand the meeting). On thise scenarios,
>> shrinking\expanding the meeting is saved only locally, and Outlook does
>> not send the updates.
>>
>> Scenario:
>> ========
>> 0. disable the Addin (Loadbehavior=0; Add-incode in the next section)
>> 1. create Meeting, send.
>> 2. close OL, enable the addin, open OL.
>> 3. go to Calendar, expand the meeting with the mouse, Outlook asks you
>> whether to send changes or not, answer Yes.
>> 4. the Addin prevents the sending.
>> 5. expand the meeting again
>> ******
>> Result: OL does not ask you whether you'd like to send changes. It simply
>> stores it locally.
>> ******
>>
>> Addin Code:
>> ==========
>> public class ThisAddIn
>>
>> Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles Me.Startup
>> AddHandler Application.ItemSend, AddressOf Application_ItemSend2
>> End Sub
>>
>> Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles Me.Shutdown
>> RemoveHandler Application.ItemSend, AddressOf
>> Application_ItemSend2
>> End Sub
>>
>> Public Sub Application_ItemSend2(ByVal Item As Object, ByRef Cancel As
>> Boolean)
>> Dim oAppt As Outlook.AppointmentItem
>> Dim oMeet As Outlook.MeetingItem
>> Try
>> oAppt = TryCast(Item, Outlook.AppointmentItem)
>> If oAppt Is Nothing Then
>> oMeet = TryCast(Item, Outlook.MeetingItem)
>> If oMeet IsNot Nothing Then
>> 'Removing this line prevent the behavior:
>> oAppt = Item.GetAssociatedAppointment(False)
>> End If
>> End If
>> If oAppt IsNot Nothing Then
>> Cancel = True
>> End If
>> Catch ex As Exception
>> MsgBox("error! " + ex.ToString())
>> Finally
>> Try
>> Runtime.InteropServices.Marshal.ReleaseComObject(Item)
>>
>> Runtime.InteropServices.Marshal.FinalReleaseComObject(oAppt)
>>
>> Runtime.InteropServices.Marshal.FinalReleaseComObject(oMeet)
>> oAppt = Nothing
>> oMeet = Nothing
>> Catch ex As Exception
>> End Try
>> End Try
>> End Sub
>>
>> End class
>>
>> Note:
>> =====
>> 1. The line which cause the problem, in my example, is:
>> oAppt = Item.GetAssociatedAppointment(False)
>> If I remove it - OL works fine, and alwayes asks about sending the
>> changed meeting.
>>
>> It's probabaly just an example, and I guess that there are more
>> operations that'll cause similiar efect.
>>
>> 2. Opening the meeting and updating it - works fine.
>>
>>
>> Thanks in advanced.
>> Moshe
>>
>>
>>
>>
>>
>>
>
date: Tue, 19 Aug 2008 17:02:42 +0300
author: Moshe Malin am
|
|