0
我发现了以下Outlook VBA脚本,批处理打印所有电子邮件附件中的子文件夹的收件箱中的子文件夹:参考
Public Sub PrintAttachments()
Dim Inbox As MAPIFolder
Dim Item As MailItem
Dim Atmt As Attachment
Dim FileName As String
Dim i As Integer
Set Inbox = GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Parent.Folders.Item("Batch Prints")
For Each Item In Inbox.Items
For Each Atmt In Item.Attachments
' all attachments are first saved in the temp folder C:\Temp. Be sure to create this folder.
FileName = "C:\Temp\" & Atmt.FileName
Atmt.SaveAsFile FileName
' please change the program folder accordingly if the Acrobat Reader is not installed on drive C:
Shell """C:\Program Files\Adobe\Reader 8.0\Reader\acrord32.exe"" /h /p """ + FileName + """", vbHide
Next
Item.Delete 'remove this line if you don't want the email to be deleted automatically
Next
Set Inbox = Nothing
End Sub
来源:http://www.howtogeek.com/howto/microsoft-office/batch-print-pdf-attachments-in-outlook/
我的问题是:是否有可能将此脚本转换为64位,因为安装32位Office不是一个选项。
我发现PtrSafe,但只有在涉及到.dll声明时才有意义。
Office版本2016的64位
会发生什么事,当你64位的Outlook中运行呢?一般来说,香草VBA应该可以在32/64版本之间移植。 –
有趣。我收到以下错误:“运行时错误'-2147221233(8004010f)':尝试的操作失败。找不到对象。在调试器中,它突出显示: Set Inbox = GetNamespace(”MAPI“)。 GetDefaultFolder(olFolderInbox).Parent.Folders.Item(“Batch Prints”)'我已经验证了批量打印子文件夹以及Temp文件夹的存在 – Spagett
“批量打印”与“收件箱“?你开始使用收件箱,然后上到父PST文件,然后下到”批量打印“。这是正确的吗? –