D
dotnet_ottawa
I am having a problem with the Inspector.CurrentItem() method causing shared
calendar issues in Outlook 2003. The problem is as follows...
- user 1 and 2 share each others calendar
- user 1 creates a meeting request and sends it to user 2
- user 2 opens the meeting request, changes something [e.g. location] and
sends the update back to user 1
- user 1 sees the meeting request update on the calendar; however, when the
meeting request is opened, the OLD information is displayed, rather than the
updates
I have stripped out all add-in code and narrowed it down to the
Inspector.CurrentItem() method. This method call causes the problem, and
commenting it out makes the problem go away. I however need to test what type
of Outlook object is returned by the Inspector.CurrentItem
My stripped-down code is below.
Any ideas.
**********************************************************
Option Explicit On
Option Strict On
Imports System
Imports Microsoft.Office.Core
Imports System.Runtime.InteropServices
Imports Microsoft.win32
Imports Microsoft.Office.Interop
<GuidAttribute("213CA206-ADED-4C80-A8D6-C2B38E343234"),
ProgIdAttribute("MyAddin.Connect")> _
Public Class Connect
Implements Extensibility.IDTExtensibility2
Private WithEvents inspectors As Outlook.Inspectors
Private applicationObject As Outlook.Application
Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnBeginShutdown
End Sub
Public Sub OnAddInsUpdate(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnAddInsUpdate
End Sub
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
inspectors = Me.applicationObject.Inspectors
End Sub
Public Sub OnDisconnection(ByVal RemoveMode As
Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnDisconnection
End Sub
Public Sub OnConnection(ByVal application As Object, ByVal connectMode
As Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
applicationObject = CType(application, Outlook.Application)
End Sub
Private Sub inspectors_NewInspector(ByVal Inspector As
Microsoft.Office.Interop.Outlook.Inspector) Handles inspectors.NewInspector
'this line causes the shared calendar problem
Dim mailItem As Outlook.MailItem = CType(Inspector.CurrentItem,
Outlook.MailItem)
End Sub
End Class
**********************************************************
calendar issues in Outlook 2003. The problem is as follows...
- user 1 and 2 share each others calendar
- user 1 creates a meeting request and sends it to user 2
- user 2 opens the meeting request, changes something [e.g. location] and
sends the update back to user 1
- user 1 sees the meeting request update on the calendar; however, when the
meeting request is opened, the OLD information is displayed, rather than the
updates
I have stripped out all add-in code and narrowed it down to the
Inspector.CurrentItem() method. This method call causes the problem, and
commenting it out makes the problem go away. I however need to test what type
of Outlook object is returned by the Inspector.CurrentItem
My stripped-down code is below.
Any ideas.
**********************************************************
Option Explicit On
Option Strict On
Imports System
Imports Microsoft.Office.Core
Imports System.Runtime.InteropServices
Imports Microsoft.win32
Imports Microsoft.Office.Interop
<GuidAttribute("213CA206-ADED-4C80-A8D6-C2B38E343234"),
ProgIdAttribute("MyAddin.Connect")> _
Public Class Connect
Implements Extensibility.IDTExtensibility2
Private WithEvents inspectors As Outlook.Inspectors
Private applicationObject As Outlook.Application
Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnBeginShutdown
End Sub
Public Sub OnAddInsUpdate(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnAddInsUpdate
End Sub
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
inspectors = Me.applicationObject.Inspectors
End Sub
Public Sub OnDisconnection(ByVal RemoveMode As
Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnDisconnection
End Sub
Public Sub OnConnection(ByVal application As Object, ByVal connectMode
As Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
applicationObject = CType(application, Outlook.Application)
End Sub
Private Sub inspectors_NewInspector(ByVal Inspector As
Microsoft.Office.Interop.Outlook.Inspector) Handles inspectors.NewInspector
'this line causes the shared calendar problem
Dim mailItem As Outlook.MailItem = CType(Inspector.CurrentItem,
Outlook.MailItem)
End Sub
End Class
**********************************************************