Python - Office Communicator API - 是否可以在有限制的情况下发送消息

标签 python api office-communicator

我在 Python 中使用 win32com 弄乱了许多 Office 程序。

Excel很好用,Outlook很简单,满足了我的基本使用需求。

我有 Microsoft Lync,但在使用时遇到问题。

我知道有限制,但我想做的是;发送消息,检测收到的消息并回复。

我使用下面的代码打开一个新窗口:

import win32com.client

msg = win32com.client.Dispatch('Communicator.UIAutomation')
msg.InstantMessage('me@me.com')

这可以很好地打开信使窗口,但任何发送消息的方法通常都会引发“未实现”错误。我知道 api 受到限制,但我想知道是否可以通过这种方式发送消息或检测收到的消息,或者是否有其他与 Communicator 通信的方式?

我真的不想使用 SendKeys 方法来编写消息。任何帮助将不胜感激。

最佳答案

与其尝试驱动 Communicator GUI 程序,不如考虑实现底层聊天协议(protocol)的接口(interface)。

Communicator 可以说 XMPP protocol - 与 Google Talk、Facebook Chat 等相同。

来自维基百科:

Furthermore, several enterprise IM software products that do not natively use XMPP nevertheless include gateways to XMPP, including:

  • IBM Lotus Sametime
  • Microsoft Lync Server (formerly named Microsoft Office Communications Server – OCS)

您应该能够实现自己的 XMPP 客户端。 libpurple , Pidgin 背后的聊天协议(protocol)库, 实现 XMPP;如果你愿意,你可以使用它。

关于Python - Office Communicator API - 是否可以在有限制的情况下发送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10581740/

相关文章:

python - 如何在 vim 中启用 python3?

python - 将 subprocess.call stdout 存储在变量中并将其作为 json 加载回来

api - 要求 REST api 请求包含 cookie 是个好主意吗?

c# - 将 Microsoft Office Communicator 2007 集成到 ASP.NET 页面中

vba - Lync 2013 for VBA 的通信器 API 去了哪里?

python - 在使用 pyparsing 制作递归解析器时需要帮助

postgresql - 如何用 Python 编写这段代码?

api - Jmeter 性能测试 - 使用 JSR223 采样器从 API 和从 MongoDB 获得的结果计数差异

javascript - 使用 API 中的 $http.get 进行 Angular.js 本地开发

office-communicator - Office Communicator 在线状态如何工作?