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文件,然後下到」批量打印「。這是正確的嗎? –