Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Communicator 2007 from VBA - Status help 1

Status
Not open for further replies.

mndiscer

Programmer
Sep 8, 2010
11
US
Hello, I need help pulling the status of a single contact from Communicator. I have the send code figured out. Just can't seem to compile the right verbiage for the status. Want I want is an if statment where depending on the status of the contact it will either send an IM or email. I can figure out the if statment I just need to know how pull the status into a variable.

The code I have to send a message is
Private Sub Command17_Click()
Dim msgr As CommunicatorAPI.IMessengerConversationWndAdvanced
Dim Name As String
Dim TimeOut As String
Dim strTo As String
Dim strMsg As String
Dim Minutes As String

If IsNull(Me.EmailV) Then
MsgBox "Employee is not assigned to department, so no notifications can be sent."
Else
Name = Me.FirstLastV
TimeOut = Me.NoOTClockOut
Minutes = Abs(Me.MinutesV)
'Forms!OverTime![SF-OverTime].Form.EmailV
strTo = Me.EmailV
If Me.NoOTClockOut = "*Already on OT" Then
strMsg = Name & " is currently on OVERTIME, they were supposed to clock out " & Minutes & " minutes ago!"
Else
strMsg = Minutes & " minute reminder to clock " & Name & " out at " & TimeOut & " ot avoid Overtime!"
End If
On Error Resume Next
Set msgr = Messenger.InstantMessage(strTo)
msgr.SendText (strMsg) 'Only for Communicator 2007

'msgr.Close

End If
End Sub


Much thanks!
 

hi,

this works with my IM...
Code:
    Dim oIM As CommunicatorAPI.Messenger, oIMCon As Object
        
    Set oIM = New CommunicatorAPI.Messenger
    
    For Each oIMCon In oIM.MyContacts
        Debug.Print oIMCon.FriendlyName, oIMCon.Status
    Next



Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Awesome, awesome, awesome - much thanks... So simple...
 

BTW, I use the Object Browser, and Watch Window a lot to discover stuff about a new object model, like IM, which I have NEVER looked at before today.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top