问题描述
有什么方法可以在 Outlook 中编写一个 VBA 宏来强制打印输出到特定打印机(即使它不一定是默认打印机),类似于 Word
Is there any way to write a VBA macro in Outlook that forces a printout to a specific printer (even if it's not necessarily the default printer), similar to the Word
Application.ActivePrinter = "Printer Name"
选项?我想创建一个按钮,将当前电子邮件和附件打印到特定打印机(在本例中为 PDF 打印机,但我猜无论如何它都应该是相同的原理),但似乎找不到方法强制在代码中使用哪个打印机.
option? I'd like to create a button that prints the current email and attachments to a specific printer (in this case a PDF printer, but I'm guessing it should be the same principle regardless), but can't seem to find a way to force which printer is used in the code.
推荐答案
不,Outlook 只公开 MailItem.PrintOut
方法.
No, Outlook only exposes MailItem.PrintOut
method.
您可以使用 MailItem.SaveAs 将邮件保存为 DOC 或 RTF 格式,在 Word 中打开它,然后使用 Word 对象模型进行打印.
You can save the message in the DOC or RTF format using MailItem.SaveAs, open it in Word, and use the Word Object Model to print it.
这篇关于使用 VBA 告诉 Outlook 打印到特定打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!