Text Property

Description:

The Text property has the text message of the incoming SMS.

   

Usage
  • strText = ObjectName.Inbox.Message(Index).Text
  • strText = ObjectName.Inbox(Index).Text
Value Type String
Access Mode Read Only

Usage Example:

Visual Basic / ASP (VBScript)
Dim objSMS As mCore.SMS, i As Integer
Dim Inbox As Inbox, Message As Message
Set objSMS = New mCore.SMS
' You can also use Set objSMS = CreateObject("mCore.SMS")
' In case of ASP (VBScript) to create object use
' Set objSMS = Server.CreateObject("mCore.SMS")
' In ASP use Response.Write instead of MsgBox
objSMS.Port = "COM2"
objSMS.BaudRate = 57600
objSMS.Parity = "N"
objSMS.DataBits = 8
objSMS.StopBits = "1"
objSMS.MessageMemory = "SM"
Set Inbox = objSMS.Inbox
Inbox.Concatenate = True
Inbox.Refresh
If Not objSMS.IsError(True) And Inbox.HasMessages Then
     MsgBox "Total " & Inbox.Count & " incoming messages!"
     For Each Message In objSMS.Inbox
          i = Message.Index
          MsgBox "Msg Index: " & CStr(i) & vbCrLf & _
            Message.TimeStampRFC & vbCrLf & "From: " _
             & Message.Phone & vbCrLf & Message.Text
     Next

     ' The following code also generates the same result as above
     ' Note the various ways of getting each message in the Inbox
     ' e.g. Inbox(i), Inbox.Message(i) etc.
     For i = 1 To Inbox.Count
          MsgBox "Msg Index:" & CStr(i) & vbCrLf & _
           Inbox(i).TimeStampRFC & vbCrLf & "From: " _
           & objSMS.Inbox.Message(i).Phone & vbCrLf _
           & objSMS.Inbox.Message(i).Text
     Next
End If

' The following code demonstrates the change in message index
' values after calling the Delete method. You must have more
' than one incoming messages in the modem to understand the
' significance of the following code.
MsgBox "Total " & Inbox.Count & " incoming messages!"
If Inbox.Count >= 2 Then
     Inbox.Message(1).Delete
     MsgBox "Total " & Inbox.Count & " messages in Inbox!"
     For i = 1 To Inbox.Count
          MsgBox "Msg Index:" & CStr(i) & vbCrLf & _
           Inbox(i).TimeStampRFC & vbCrLf & "From: " _
           & objSMS.Inbox.Message(i).Phone & vbCrLf _
           & Inbox.Message(i).Text
     Next
End If
Set objSMS = Nothing

  

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved