Office Communicator Verify – User Status
Office Communicator display list of Friends added in it along with their availability status (whether they are available at their desk, away, Idle or away).
But to check this, they should be first added to Communicator. What if you want to do a Anonymous Monitoring?
User Status – Without Adding User to Office Communicator
If their Id is not in your Office communicator list & you want to know the status (provided they have login account), the steps explained below can be used with Excel VBA.
To get this we need their Communicator Login Id or Email ID.
12345678910111213141516171819Public Sub Office_Communicator_Verify_User_Status_OCS()Dim myOCS As New CommunicatorAPI.Messenger 'Office Communicator API LibraryDim OCS_User_Mail_ID As StringDim curr_status As IntegerDim flag As IntegerDim stat As Stringstat = ""OCS_User_Mail_ID = "User@mail.com" 'Change the Mail ID to USER Mail.curr_status = myOCS.GetContact(OCS_User_Mail_ID, myOCS.MyServiceId).StatusIf curr_status = 34 Then stat = "Away"If curr_status = 10 Then stat = "Busy"If curr_status = 18 Then stat = "Idle"If curr_status = 1 Then stat = "Offline"If curr_status = 2 Then stat = "Online"If curr_status = 0 Then stat = "Unknown"MsgBox "User:" & OCS_User_Mail_ID & " OCS Status = " & statEnd Sub
- Create a New Excel Workbook.
- Press Alt + F11 to activate VB Editor.
- Go to Menu Tools -> Reference and Add “Microsoft Office Communicator API Library“. To use this code, Office Communicator should be installed in the system and a valid user login is required.
- Copy paste the code and run the code by pressing F5 key.
- Message box will pop up to display the user status for the User id provided in “OCS_User_Mail_Id”.
If you have list of Mail IDs in an excel sheet, the above code can be customized to read the list in a loop and get status of each user. The same code can also be used for Friends already added to in Friends list.
- With a Timer enabled along with this, the code can be made to run repeatedly and User’s available time at his desk or Office Communicator can be calculated. i.e., this code along with “Application.OnTime” functionality, can be used as a productivity calculator software. (Reference for adding Timer to Excel Macro)
- When we have list of Email Ids in Excel and want to send mail though Office Outlook to that list, refer this topic
More Tips: Remove Duplicate Values From Excel Sheet
Microsoft Office – Communicator API – Verify Availability Status