peer754
02-14-2014, 04:47 AM
Hi,
I have a VBA application that synchronizes the Calendar with SQL server. One of the columns in my DB table needs to show the current IM presence status image the same way you'll see it in Outlook or in the Messenger client.
I have managed to connect and get values from my Messenger object but fail when trying to implement the event handler OnMyStatusChange. My VBA project gets compilation error saying "Procedure declaration does not match description of event or procedure having the same name".
Public WithEvents oComm As CommunicatorAPI.Messenger
Set oComm = CreateObject("Communicator.UIAutomation")
Private Sub oComm_OnMyStatusChange(hr As Long, ByRef mMyStatus As MISTATUS)
Dim username As String
If hr = S_OK Then
MsgBox "My status changed from " + CStr(mMyStatus)
End If
' Do something like get the new status and update the DB
End Sub
When I look into the object explorer I see that the doc for the Messenger class event handlers exactly assumes this implementation:
Event OnMyStatusChange(hr As Long, mMyStatus As MISTATUS) Member of CommunicatorAPI.Messenger My status changed.
Please, anyone, I have googled this for days now and I seem to be the only one on this planet facing these problems :(
Office 2010, Communicator 2007
Thanks, Peer
I have a VBA application that synchronizes the Calendar with SQL server. One of the columns in my DB table needs to show the current IM presence status image the same way you'll see it in Outlook or in the Messenger client.
I have managed to connect and get values from my Messenger object but fail when trying to implement the event handler OnMyStatusChange. My VBA project gets compilation error saying "Procedure declaration does not match description of event or procedure having the same name".
Public WithEvents oComm As CommunicatorAPI.Messenger
Set oComm = CreateObject("Communicator.UIAutomation")
Private Sub oComm_OnMyStatusChange(hr As Long, ByRef mMyStatus As MISTATUS)
Dim username As String
If hr = S_OK Then
MsgBox "My status changed from " + CStr(mMyStatus)
End If
' Do something like get the new status and update the DB
End Sub
When I look into the object explorer I see that the doc for the Messenger class event handlers exactly assumes this implementation:
Event OnMyStatusChange(hr As Long, mMyStatus As MISTATUS) Member of CommunicatorAPI.Messenger My status changed.
Please, anyone, I have googled this for days now and I seem to be the only one on this planet facing these problems :(
Office 2010, Communicator 2007
Thanks, Peer