Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21278

Office Communicator / Lync (CommunicatorAPI) IMessengerContact Class(es)

$
0
0
I'm looking for some examples of using either the IMessengerContact and/or IMessengerContactAdvanced, and the IMessengerConversationWndAdvanced classes of the CommunicatorAPI object. I've successfully written a VB6 class that fires when a new IM window is created but need to determine who created or initiated the IM conversation as well as the message that was received.

All attempts to use either IMessengerContact* classes and their FriendlyName and SigninName members have been unsuccessful. In addition, I've had no luck using he IMessengerConversationWndAdvanced classes History member.

The following code works flawlessly but I would really like to expand on it as explained above.

frmOutpage.frm
(General) (Declarations)
Public CommunicatorMonitor As clsCommunicator

Private Sub InitProc()
Set CommunicatorMonitor = New clsCommunicator
End Sub

clsCommunicator.cls
(General) (Declarations) Option Explicit
Public WithEvents CommunicatorApplication As CommunicatorAPI.Messenger

Public Sub Class_Initialize()
Set CommunicatorApplication = New CommunicatorAPI.Messenger
End Sub

Private Sub CommunicatorApplication_OnIMWindowCreated(ByVal objIMWindow As Object)
Dim objWindow As CommunicatorAPI.IMessengerConversationWndAdvanced

Set objWindow = objIMWindow

'- I do not want to send the following message if I am the one initiating the IM conversation...
If CommunicatorApplication.MyStatus <> 2 Then '- 2 = MISTATUS_ONLINE
objWindow.SendText ("I am currently away from my desk. Your IM has been automatically forwarded to my mobile device and I will respond as required as soon as possible.")
End If

Set objWindow = Nothing
End Sub

Viewing all articles
Browse latest Browse all 21278

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>