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!
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!