vba 使用VBA拨打手机
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1313940/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Use VBA to call a cellphone
提问by PowerUser
About a year ago, a manager in another department brainstormed that I could code up some VBA to auto call me in the event one of my automated reports crashes. I laughed at the time, but my skills have improved considerably and I wonder if it's technically possible
大约一年前,另一个部门的一位经理集思广益,说我可以编写一些 VBA 代码,以便在我的一个自动报告崩溃时自动呼叫我。我当时笑了,但是我的技术进步了很多,不知道技术上是否可行
(not that I'd actually do it, mind you. I like my early Saturday mornings workplace-free).
(并不是说我真的会这样做,请注意。我喜欢周六早上没有工作的地方)。
This would need:
1. Access to the internet (not a problem)
2. A means of connecting to some service to place the call, preferably free, lest I cost the company $10 a month (Skype?)
3. An automated voice (already exists on the standard Access install package)
这将需要:
1. 访问互联网(不是问题)
2. 一种连接到某些服务以拨打电话的方式,最好是免费的,以免我每月花费公司 10 美元(Skype?)
3. 自动语音(已经存在于标准 Access 安装包中)
What do you think?
你怎么认为?
Edited 08/24/2009 - Spacing added. No text was changed.
2009 年 8 月 24 日编辑 - 添加了间距。没有更改文本。
回答by Juliet
Do the simplest thing that could possibly work. In this case, making phonecalls is hard, but sending emails is easy.
做可能有效的最简单的事情。在这种情况下,打电话很难,但发送电子邮件很容易。
Most cellphone providers expose a phone's mailbox (something like [email protected]) to the internet, allowing you to send an email to that address and have it show up on your phone as a text message.
大多数手机提供商将手机的邮箱(例如 [email protected])暴露在互联网上,允许您向该地址发送电子邮件,并将其作为短信显示在您的手机上。
回答by Dirk Vollmar
You can use Skype in combination with VBA. It's actually not that complicated and you will find a couple of sampleswritten in VBScript on the Skype website. I don't know whether it is possible to actually play an audio file, but you can send SMSeasily:
您可以将 Skype 与 VBA 结合使用。它实际上并没有那么复杂,您会在 Skype 网站上找到几个用 VBScript 编写的示例。我不知道是否可以实际播放音频文件,但是您可以轻松发送短信:
'// Create a Skype4COM object:
Set oSkype = WScript.CreateObject("Skype4COM.Skype", "Skype_")
'// Start the Skype client:
If Not oSkype.Client.IsRunning Then oSkype.Client.Start() End If
'// Send SMS:
Set oSMS = oSkype.SendSms("+1234567890", "Hello!")
WScript.Sleep(60000)
'// Message event handler:
Public Sub Skype_SmsMessageStatusChanged(ByRef aSms, ByVal aStatus)
WScript.Echo ">Sms " & aSms.Id & " status " & aStatus & " " & oSkype.Convert.SmsMessageStatusToText(aStatus)
End Sub
'// Target event handler:
Public Sub Skype_SmsTargetStatusChanged(ByRef aTarget, ByVal aStatus)
WScript.Echo ">Sms " & aTarget.Message.Id & " target " & aTarget.Number & " status " & aStatus & " " & oSkype.Convert.SmsTargetStatusToText(aStatus)
End Sub
回答by Darknight
If you have a old dial up modem, then you could (in 'old VB6 days) dial via the modem programmatically, however I'm not sure if its possible in VBA. The next challange would be to get the audio down the line.
如果您有一个旧的拨号调制解调器,那么您可以(在旧的 VB6 时代)以编程方式通过调制解调器拨号,但是我不确定它是否可以在 VBA 中使用。下一个挑战是让音频上线。
I would suggest that you butcher a headless earphone & microphone that connects to phones, you could then take a 3.5mm audio Hymanfrom your PC speaker output and connect this to the headless earphone/microphone set, unless there are cables that already do that (possibly).
我建议您购买连接到手机的无头耳机和麦克风,然后您可以从您的 PC 扬声器输出端取一个3.5 毫米音频插孔并将其连接到无头耳机/麦克风组,除非有电缆已经这样做了(可能)。
Then it would be a simple matter of coding up Microsofts 'text to speech' engine.
然后就可以简单地编写微软的“文本到语音”引擎。
Darknight
黑夜
回答by Dick Kusleika
http://chandoo.org/wp/2009/02/05/twitter-from-excel/. Set up a twitter account that pings your phone and create twitters with this.
http://chandoo.org/wp/2009/02/05/twitter-from-excel/。设置一个 twitter 帐户来 ping 您的手机并使用它创建 twitter。
It's not as easy as the email idea, but you could be the first person to tweet from Excel for a reason other than novelty.
这不像电子邮件的想法那么容易,但你可能是第一个因为新奇之外的原因从 Excel 发推文的人。
回答by Toby Allen
Another quite simple option is to send yourself a text message which is almost but not quite as easy to do as sending an email, but much easier to recieve. Companies such as clickatell.comprovide cheap web based text services with good api's where once you are signed up all you need do is call a URL and you can send a text message.
另一个非常简单的选择是给自己发送一条短信,这几乎不像发送电子邮件那么容易,但更容易接收。clickatell.com等公司提供廉价的基于 Web 的文本服务和良好的 api,一旦您注册,您只需调用 URL 即可发送短信。
Well worth a try.
非常值得一试。