开发者

sending SMS with VBA

does anyone know if this is possible?

i was able to succesfully run hyperterminal and use it to开发者_开发问答 send texts through my phone which is attached by USB.

anyone know how to do it in VBA?


If you know the other party e-mail address you can just send e-mail. Otherwise you will need a SMS gateway supplier which can deliver the messages to the correct networks.


Try this:

Public Sub SendSMS(ByVal Recipient As String, ByVal Message As String)
  Dim n As Integer

  n = FreeFile
  ' Change  the string below if using a different COM port or the port speed
  Open "COM1:9600,N,8,1" For Output As #n
  Print #n, "<SMS command string>"
  Close #n
End Sub

Unfortunately, I don't have a data cable for my phone handy so I can't try it!

Also, be aware that you may not have access to the serial port if you're not running as a privileged user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜