如何將新聯繫人自動同步到 Outlook 中的另一個聯繫人文件夾

立即分享:

某些用戶希望新聯繫人能夠自動添加到 Outlook 中的兩個或多個文件夾中。 因此,本文將分享一種將新聯繫人自動同步到另一個聯繫人文件夾的方法。

也許您在 Outlook 中配置了多個電子郵件帳戶。 他們每個人都有自己的“聯繫人”文件夾。 在這種情況下,當您在一個文件夾中創建聯繫人時,您可能也希望將其同步到其他電子郵件帳戶的“聯繫人”文件夾。 為什麼不讓 Outlook 自動完成呢? 下面我們就教大家如何實現。

自動將新聯繫人同步到 Outlook 中的另一個聯繫人文件夾

自動將新聯繫人同步到另一個聯繫人文件夾

  1. 首先,您需要啟動 Outlook 程序。
  2. 然後,在 Outlook 主窗口中,按快捷鍵 –“Alt + F11”。
  3. 接下來,您將進入“Microsoft Visual Basic for Applications”窗口,在其中您應該找到並打開“ThisOutlookSession”項目。
  4. 隨後,複製以下 VBA 代碼並將其粘貼到項目中。
Public WithEvents objSourceFolder As Outlook.Folder
Public WithEvents objContacts As Outlook.Items

Private Sub Application_Startup()
    'Get the source Contacts folder
    Set objSourceFolder = Application.Session.GetDefaultFolder(olFolderContacts)
    Set objContacts = objSourceFolder.Items
End Sub

'Occurs when new item is added to the source folder
Private Sub objContacts_ItemAdd(ByVal Item As Object)
    Dim objContact As Outlook.ContactItem
    Dim objTargetFolder As Outlook.Folder
    Dim objCopiedContact As Outlook.ContactItem
 
    If TypeOf Item Is ContactItem Then
       Set objContact = Item
 
       'Specify the target Contacts folder
       '"Personal" refers to the displaying name of target Outlook file
       On Error Resume Next
       Set objTargetFolder = Application.Session.Folders("Personal").Folders("Contacts").Folders("From John Smith")
       If objTargetFolder Is Nothing Then
          Set objTargetFolder = Application.Session.Folders("Personal").Folders("Contacts").Folders.Add("From John Smith")
       End If
 
       'Copy the new contact
       Set objCopiedContact = objContact.Copy
       'Move copied contact to the target folder
       objCopiedContact.Move objTargetFolder
    End If
End Sub

VBA代碼-自動將新聯繫人同步到另一個聯繫人文件夾

  1. 之後,您需要簽署此代碼。 只需單擊工具欄中的“工具”按鈕,然後選擇“數字簽名”即可。 在彈出的對話框中,只需按照屏幕上的說明操作即可。
  2. 稍後您可以退出當前窗口並更改 Outlook 宏設置以允許數字簽名的宏。
  3. 最後,你可以重新tar用Outlook激活此新宏。
  4. 從現在起,每次將新聯繫人添加到源文件夾時,都會自動同步到預定義的聯繫人 tar獲取文件夾。

應對常見的 Outlook 問題

如果您使用 Outlook 幾十年了,您一定遇到過各種各樣的問題,包括 Outlook 死機、頻繁出現錯誤消息、PST 文件損壞等。 一般情況下可以嘗試通過res來解決tar在安全模式下設置 Outlook、創建新的 Outlook 配置文件、禁用有故障的加載項等。當然,您可以藉助強大的修復工具,例如 DataNumen Outlook Repair。 它可以 修復PST 像軟木塞的錯誤。

作者簡介:

Shirley Zhang是的數據恢復專家 DataNumen,Inc.是數據恢復技術的全球領導者,包括 維修MDF 和Outlook修復軟件產品。 欲了解更多信息,請訪問 萬維網。datanumen.COM

立即分享:

評論被關閉。