The Refresh method of Inbox collection object refreshes the Inbox by reading all the messages from the GSM modem or phone. The optional parameter MessageType specifies whether only unread messages or only read messages or both read and unread messages are retrieved. The memory location from where the incoming messages are read is specified in the MessageMemory property.
| Usage | blnResult = ObjectName.Inbox.Refresh([MessageType]) |
| Parameters | MessageType As Integer (Optional). 0 - Retrieve only unread messages; 1 - Retrieve only read messages; 2 - Retrieve both read and unread messages (Default value is 2) |
| Returns |
Boolean value
|
| Visual Basic / ASP (VBScript) |
| Dim objSMS As mCore.SMS,
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.Inbox.Concatenate = True objSMS.MessageMemory = "SM" objSMS.Inbox.Refresh If objSMS.Inbox.HasMessages Then MsgBox "Total " & objSMS.Inbox.Count & " incoming messages!" For Each Message In objSMS.Inbox MsgBox Message.TimeStampRFC & vbCrLf & "From: " & _ Message.Phone & vbCrLf & Message.Text Next End If Set objSMS = Nothing |