Specifications

Chapter 10. Case Studies
Delete Condition (String) Delete all messages that match the
condition
Load Message-ID (Number) Return the message indicated by the
Message-ID
FindFirstMessage Condition (String) Return the first message that matches
the condition
FindNextMessage None Return the next message
GetDirectionDescription Direction-code
(Number)
Look-up the friendly direction
description of the given direction-code
GetStatusDescription Status-code (Number) Look-up the friendly status description
of the given direction-code
GetTypeDescription Type (Number) Look-up the friendly type description
of the given direction-code
Sample:
' Sample: count all incoming messages in the message database
Set colMessages = CreateObject( "AxSmsServer.Messages" )
Set objConstants = CreateObject( "AxSmsServer.Constants" )
n = colMessages.Count( "Direction = " & objConstants.
objConstants.MESSAGEDIRECTION_OUT )
If( colMessages.LastError = 0 ) Then
WScript.Echo "#Records: " & r
End If
Sample:
' Sample: create new outgoing SMS message
Set objConstants = CreateObject( "AxSmsServer.Constants" )
Set colMessages = CreateObject( "AxSmsServer.Messages" )
Set objMessage = colMessages.Create
If( colMessages.LastError <> 0 ) Then
WScript.Echo "Create failed, error: " & colMessages.LastError
Exit Function
End If
WScript.Echo "Message successfully created, recordID: " & objMessage.ID
objMessage.Direction = objConstants.MESSAGEDIRECTION_OUT
objMessage.Type = objConstants.MESSAGETYPE_EMAIL
objMessage.Status = objConstants.MESSAGESTATUS_OUT_SCHEDULED
objMessage.ChannelID = 0 ' Any avaialbe SMS channel
objMessage.Recipient = "+31624896641"
objMessage.Body = "Hello, world!"
colMessages.Save objMessage
WScript.Echo "Save, result: " & colMessages.LastError
9.4. ‘Message’ object
Properties:
Property Type R/W Description