I am not quite sure how to do that and my access to info is a bit limited besides what is in CCPulse directly but I thought of using IF statements to compare Threshold.CFGObjectID against the employees known ID # (shown as # where the ID # would be and NAME where the name would be) and setting the name based on that. The test seems to go okay but errors out at the end saying:
Error at
Line: 65
Position:8
Error message: Expected End
My full code is below but I am not sure why I am getting that error. I have the End Sub there for SendMail so it should be fine but it is not...
[code]
Dim msgBody
Dim thresholdInfo
Dim receipAddress
Dim empName
if (Threshold.CFGObjectID = #) then
agentName = "NAME"
if (Threshold.CFGObjectID = #) then
agentName = "NAME"
if (Threshold.CFGObjectID = #) then
agentName = "NAME"
if (Threshold.CFGObjectID = #) then
agentName = "NAME"
thresholdInfo="StatAlias:"+CStr(Threshold.StatAlias)+vbNewLine+"StatValue:"+CStr(round(Threshold.StatValue/60,2))+vbNewLine+"CFGObjectID:"+CStr(Threshold.CFGObjectID)+vbNewLine+"empName:"+CStr(empName)+vbNewLine
receipAddress="email"
'Call our function with recipient, message, and subject
SendMail receipAddress,msgBody+thresholdInfo,"CCPulse Alarm Notification"
Sub SendMail(recipient,msg,subject)
Dim objOutlook
Dim objOutlookMsg
Set objOutlook = CreateObject( "Outlook.Application" )
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
objOutlookMsg.To = recipient
objOutlookMsg.Subject = subject
objOutlookMsg.Body = thresholdInfo
objOutlookMsg.Importance = 2
objOutlookMsg.Send
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
[/code]