VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Nokia SMS sample using VBScript

by Anonymous (267 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 7th September 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Nokia SMS sample using VBScript

Rate Nokia SMS sample using VBScript



' You need the freeware AComport.dll to run the sample.
' Download it from http://www.vahland.com/pub/acomport.dll
' and register it on your machine.
' Read http://www.vahland.com/pub/acomport.htm for more info

Const acERR_SUCCESS = 0

' --------------------------------------------------------------
Sub WriteStr( o, str )
    o.WriteString str
    WScript.Echo "-> " & str
End Sub
' --------------------------------------------------------------
Sub ReadStr( o )
    str = "notempty"
    o.Sleep 200
    Do While str <> ""
        str = o.ReadString
        WScript.Echo "<- " & str
    Loop
End Sub
' --------------------------------------------------------------

WScript.Echo "Be sure to have the FREEWARE AComport.dll registered on your system"
WScript.Echo "Check out the code header about how to obtain the component."

Set acObj = CreateObject( "ActivXperts.Comport" )

acObj.Baudrate = 19200
acObj.PortID = 1
acObj.Open
WScript.Echo "acObj.Open, result: " & acObj.LastError

If acObj.LastError = acERR_SUCCESS Then

    WriteStr acObj, "at+cmgf=1"
    ReadStr acObj

    Do
       strNumber = inputbox("Enter the recipients phone number", "Input")
    loop until strNumber <> Chr (13)

    Do
       strMessage = inputbox("Enter the message body text", "Input" )
    loop until strMessage <> Chr (13)

    WriteStr acObj, "at+cmgs=""" & strNumber & """
    ReadStr acObj

    WriteStr acObj, strMessage

    strTermCmd = Chr( 26 ) ' Terminate message by sending [ctrl]z followed by an [enter]
    WriteStr acObj, strTermCmd
    ReadStr acObj
    
    acObj.Close

End If

Download this snippet    Add to My Saved Code

Nokia SMS sample using VBScript Comments

No comments have been posted about Nokia SMS sample using VBScript. Why not be the first to post a comment about Nokia SMS sample using VBScript.

Post your comment

Subject:
Message:
0/1000 characters