如何將Outlook文件夾結構複製到桌面(Windows資源管理器)?
如您所知,我們可以應用“存檔”功能將文件夾結構複製到另一個Outlook,但是您知道如何將Outlook文件夾結構複製到某個窗口文件夾(例如桌面)嗎? 本文將介紹一個VBA,可將Outlook文件夾結構輕鬆複製到Windows資源管理器。
將Outlook文件夾結構複製到桌面(Windows資源管理器)
- 自動發送電子郵件 自動CC / BCC, 自動前進 按規則; 傳送 自動回复 (不在辦公室)無需交換伺服器...
- 取得類似提醒 BCC警告 當您在密件副本清單中回覆所有內容時,以及 缺少附件時提醒 對於忘記的附件...
- 提高電子郵件效率 回覆(全部)並附上附件, 自動添加問候語或日期和時間到簽名或主題中, 回覆多封電子郵件...
- 簡化電子郵件發送 撤回電子郵件, 附件工具 (壓縮全部、自動儲存全部...)、 刪除重複項和 快速報告...
將Outlook文件夾結構複製到桌面(Windows資源管理器)
請按照以下步驟將Outlook文件夾結構複製到桌面或Windows資源管理器。
1.在導航窗格上,請單擊以突出顯示要復制其文件夾結構的指定文件夾,然後按 其他 + F11 鍵以打開“ Microsoft Visual Basic應用程序”窗口。
2。 點擊 工具 > 參考 打開引用對話框。 然後在對話框中檢查 Microsoft腳本運行時 選項,然後單擊 OK 按鈕。 看截圖:
3。 點擊 插入 > 模塊,然後將以下VBA代碼複製並粘貼到新的模塊窗口中。
VBA:將Outlook文件夾結構複製到Windows資源管理器
Dim xFSO As Scripting.FileSystemObject
Sub CopyOutlookFldStructureToWinExplorer()
ExportAction "Copy"
End Sub
Sub ExportAction(xAction As String)
Dim xFolder As Outlook.Folder
Dim xFldPath As String
xFldPath = SelectAFolder()
If xFldPath = "" Then
MsgBox "You did not select a folder. Export cancelled.", vbInformation + vbOKOnly, "Kutools for Outlook"
Else
Set xFSO = New Scripting.FileSystemObject
Set xFolder = Outlook.Application.ActiveExplorer.CurrentFolder
ExportOutlookFolder xFolder, xFldPath
End If
Set xFolder = Nothing
Set xFSO = Nothing
End Sub
Sub ExportOutlookFolder(ByVal OutlookFolder As Outlook.Folder, xFldPath As String)
Dim xSubFld As Outlook.Folder
Dim xItem As Object
Dim xPath As String
Dim xFilePath As String
Dim xSubject As String
Dim xCount As Integer
Dim xFilename As String
On Error Resume Next
xPath = xFldPath & "\" & OutlookFolder.Name
'?????????,??????
If Dir(xPath, 16) = Empty Then MkDir xPath
For Each xItem In OutlookFolder.Items
xSubject = ReplaceInvalidCharacters(xItem.Subject)
xFilename = xSubject & ".msg"
xCount = 0
xFilePath = xPath & "\" & xFilename
If xFSO.FileExists(xFilePath) Then
xCount = xCount + 1
xFilename = xSubject & " (" & xCount & ").msg"
xFilePath = xPath & "\" & xFilename
End If
xItem.SaveAs xFilePath, olMSG
Next
For Each xSubFld In OutlookFolder.Folders
ExportOutlookFolder xSubFld, xPath
Next
Set OutlookFolder = Nothing
Set xItem = Nothing
End Sub
Function SelectAFolder() As String
Dim xSelFolder As Object
Dim xShell As Object
On Error Resume Next
Set xShell = CreateObject("Shell.Application")
Set xSelFolder = xShell.BrowseForFolder(0, "Select a folder", 0, 0)
If Not TypeName(xSelFolder) = "Nothing" Then
SelectAFolder = xSelFolder.self.Path
End If
Set xSelFolder = Nothing
Set xShell = Nothing
End Function
Function ReplaceInvalidCharacters(Str As String) As String
Dim xRegEx
Set xRegEx = CreateObject("vbscript.regexp")
xRegEx.Global = True
xRegEx.IgnoreCase = False
xRegEx.Pattern = "\||\/|\<|\>|""|:|\*|\\|\?"
ReplaceInvalidCharacters = xRegEx.Replace(Str, "")
End Function
4。 按 F5 鍵或單擊 跑 按鈕以運行此VBA。
5. 在彈出的瀏覽資料夾對話方塊中,請選擇您將放置複製的資料夾結構的指定資料夾,然後按一下 OK 按鈕。 看截圖:
現在轉到指定的資料夾,您將看到資料夾結構已複製到指定的硬碟上。 看截圖:
備註:資料夾項目,如電子郵件、約會、任務等也複製到硬碟中對應的資料夾。
相關文章
最佳辦公生產力工具
Kutools for Outlook - 超過 100 種強大的功能可增強您的 Outlook
🤖 人工智慧郵件助手: 具備人工智慧魔力的即時專業電子郵件——一鍵天才回覆、完美語調、多語言掌握。輕鬆改變電子郵件! ……
📧 電子郵件自動化: 外出(適用於 POP 和 IMAP) / 安排發送電子郵件 / 發送電子郵件時按規則自動抄送/密件副本 / 自動轉送(進階規則) / 自動添加問候語 / 自動將多收件者電子郵件拆分為單獨的訊息 ...
📨 電子郵件管理: 輕鬆回憶電子郵件 / 按主題和其他人阻止詐騙電子郵件 / 刪除重複的電子郵件 / 進階搜索 / 合併資料夾 ...
📁 附件專業版: 批量保存 / 批量分離 / 批量壓縮 / 自動保存 / 自動分離 / 自動壓縮 ...
🌟 介面魔法: 😊更多又漂亮又酷的表情符號 / 使用選項卡式視圖提高 Outlook 工作效率 / 最小化 Outlook 而不是關閉 ...
👍 一鍵奇蹟: 使用傳入附件回覆全部 / 反網路釣魚電子郵件 / 🕘顯示寄件者的時區 ...
👩🏼🤝👩🏻 通訊錄和行事曆: 從選定的電子郵件中大量新增聯絡人 / 將聯絡人群組拆分為各組 / 刪除生日提醒 ...
超過 100特點 等待您的探索! 按此處了解更多。