Modified:
30/11/2005
Application ID: #5808
Option Explicit
Dim objGsmIn
Dim objConstants
Dim nNumDevices, strDevices, i
Dim numMessages
Set objGsmIn = CreateObject ( "ActiveXperts.GsmIn" )
Set objConstants = CreateObject ( "ActiveXperts.SmsConstants" )
' Message storage constants
Wscript.Echo "ActiveXperts SMS and Pager Toolkit " & objGsmIn.Version & " demo."
Wscript.Echo "Expiration date: " & objGsmIn.ExpirationDate & vbCrLf
nNumDevices = objGsmIn.GetDeviceCount()
strDevices = "*** Enter one of the following device names *** " & vbCrLf & vbCrLf
For i = 0 To nNumDevices-1
strDevices = strDevices & objGsmIn.GetDevice( i )
strDevices = strDevices & vbCrLf
Next
strDevices = strDevices & "COM1" & vbCrLf & "COM2" & vbCrLf & "COM ..." & vbCrLf
' Set device
Do
objGsmIn.Device = inputbox( strDevices, "Input" )
Loop until objGsmIn.Device <> ""
' Set logfile
objGsmIn.LogFile = "c:\SmsReceive.txt"
' Do not remove messages from memory after receive
objGsmIn.DeleteAfterReceive = FALSE
' Set message memory ( SIM Memory )
' When receiving messages failed, change this propery to asSTORAGE_DEVICE
objGsmIn.Storage = objConstants.asSTORAGE_SIM
' Enter PinCode ( optional )
' objGsmIn.EnterPin ( "1234" )
' Read messages
objGsmIn.Receive ()
if ( objGsmIn.LastError <> 0 ) Then
WScript.Echo "Failed to receive, error: " & objGsmIn.LastError & " (" & objGsmIn.GetErrorDescription( objGsmIn.LastError ) & ")"
End If
' Loop through all received messages
objGsmIn.GetFirstMessage ()
while ( objGsmIn.LastError = 0 )
WScript.Echo "Message from: " & objGsmIn.MessageSender
wScript.Echo "Message : " & objGsmIn.MessageData
objGsmIn.GetNextMessage()
Wend
WScript.Echo "Ready."
License Information
Direct link: