问题标签 [com-automation]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
40 浏览

python - 如何打印 Outlook 电子邮件?

打开 Outlook 电子邮件后,我需要打印正文。这是代码:

错误是这样的:

0 投票
1 回答
31 浏览

vba - 通过单击更改书签范围的字体颜色

我有带有部分和书签范围的 Word 文档。我想通过单击来格式化范围(在黑色和红色之间更改字体颜色)。VBA有可能吗?

0 投票
0 回答
36 浏览

python - 如何从python调用带有vba中参数的函数?

我的python代码是

我的vba字码是

错误是自我。oleobj .InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args), ...

0 投票
3 回答
42 浏览

excel - Not able to activate worksheets

So normally when using the VBA editor, code autosuggests from available methods.properties for whatever object your referencing. I'm trying to pull data from an excel sheet into a word document using a macro on the word doc, but whenever I try to use worksheets.activate, no autosuggestion for activate comes up, leading me to think it's not actually activating. Neither can I use it from a VBA script in excel.

My script is still in it's beginning stages, but here it is so far:

the "lastRow = appXL.Cells....." is causing a type mismatch, which I believe is being caused by the fact that appXL.Cells refers to the active sheet, and the ActiveDocument is a word doc, and not a sheet. So that leads me to activating the sheet, but trying to do so causes the error "Subscript out of range," even if I explicitly type the sheet name.

Any pointers are appreciated, thanks.

0 投票
1 回答
23 浏览

python - 如果我没有登录机器,脚本不会检查邮件是否已经到达 Python

早上,我实现了一个每天运行的脚本,它需要检查带有预定参数的电子邮件是否已经到达。

仅当我在计算机上登录时,该脚本才能工作并打开 Outlook。

如果我在未登录机器的情况下运行该过程,则脚本不会与 Outlook 交互(明确不会给出错误)。

我附上代码。

你能提供支持吗?

0 投票
1 回答
36 浏览

wpf - 将处理程序添加到 .ItemAdd Outlook 事件

我的代码:

我尝试将 .ItemAdd 中的处理程序添加到名为 Inbox_ItemAdd 的方法中,并尝试了来自不同 stackoverflow 问题的解决方案,例如:Inbox.ItemAdd += New Outlook.ItemsEvents_ItemAddEventHandler(AddressOf Inbox_ItemAdd)

我没主意了。

问题是即使我使用 AddHandler 也不会触发 Inbox_ItemAdd。

0 投票
2 回答
54 浏览

c# - 在电子邮件正文中粘贴图像

我需要将我的图像(我之前存储在剪贴板中)粘贴到电子邮件正文中。我该怎么做?

SendKeys.Send("^v");在新邮件窗口打开后尝试过,但没有用。

有没有办法将图像直接放入oMailItem.Body = "";

0 投票
2 回答
111 浏览

python - win32com Outlook 客户端没有属性“GetNameSpace”

我工作得很好GetNameSpace('MAPI'),但我写了一个 ActiveState 代码:使用 win32com 导入 Outlook 联系人并且GetNameSpace不再有用。

现在代码变了:很有用GetNamespace('MAPI')。为什么会发生这种情况以及如何返回GetNameSpace('MAPI')

结果:

我正在研究 VSCode。

0 投票
1 回答
35 浏览

python - Python 通过特定单词在 Outlook 中搜索电子邮件正文并在共享点或共享驱动器中另存为 pdf

我是 Python 新手,想尝试自动化手动过程。

遍历 Outlook 文件夹并在电子邮件正文中按关键字“已批准”或“批准”或“已批准”或“批准”进行搜索。找到后,转换为 pdf,然后将 pdf 保存在唯一命名的共享驱动器或 SharePoint 文件夹中。

如果电子邮件有附件,则也保存附件。这可以用 Python 编程吗?

我们有 Outlook 2013,但我了解到 Outlook 365 有一些功能。Outlook 中的 VBA 显示为灰色。任何帮助深表感谢!

最好的问候, APA

0 投票
1 回答
35 浏览

excel - 我可以将“导出到 excel”添加到现有 VBA for Outlook 吗?

我一直在使用下面的代码来按类别计算 2 个日期之间花费的总小时数。它运行良好,现在我正在寻找一种方法,不仅可以运行此代码,还可以将收集的数据导出到特定的 Excel 工作表。下面的代码是否有一个简单的补充,或者我必须有一个完全不同的子?