跳到主要內容

如何自動將簽名插入Outlook會議請求?

在Outlook中,您可以輕鬆地將簽名自動插入到電子郵件中,但是,如果要將簽名自動插入到會議邀請中,則沒有直接的方法來解決此任務。 本文,我將討論一些有用的方法來自動將簽名插入Outlook會議請求。

使用自定義表單自動將簽名插入Outlook會議請求

使用VBA代碼自動將簽名插入Outlook會議請求


使用自定義表單自動將簽名插入Outlook會議請求

在Outlook中,您可以創建一個自定義表單以將簽名自動插入會議請求中,請執行以下操作:

1。 請導航到 日曆 窗口,然後單擊 首頁 > 新的會議 打開新的 會議 窗口。

2. 然後點擊 插入 > 簽名,然後選擇要插入的簽名,請參見屏幕截圖:

doc自動將信號插入會議1

3。 插入簽名後,繼續單擊 開發者 > 設計此表格 在新的 會議 窗口,請參見屏幕截圖:

doc自動將信號插入會議2

4。 在新屏幕中,單擊 開發者 > 發布 > 發布表單為,請參見屏幕截圖:

doc自動將信號插入會議3

5. 在彈出 發布表單為 對話框中,在 顯示屏 名稱文本框,然後單擊 發布 按鈕,請參見屏幕截圖:

doc自動將信號插入會議4

6。 然後,關閉當前會議窗口而不保存它。

7。 從現在開始,當您要創建一個帶有簽名的新會議時,請單擊 首頁 > 新產品 > 自訂表格,然後選擇您剛剛創建的表單。 簽名會自動插入會議主體,請參見屏幕截圖:

doc自動將信號插入會議5


使用VBA代碼自動將簽名插入Outlook會議請求

以下VBA代碼還可以幫助您自動插入簽名以滿足會議要求,請執行以下步驟:

1。 按住 ALT + F11 鍵打開 Microsoft Visual Basic for Applications 窗口。

2。 在 Microsoft Visual Basic for Applications 窗口,雙擊 本次展望會議 來自 Project1(VbaProject.OTM) 窗格以打開模塊,然後將以下代碼複製並粘貼到空白模塊中。

VBA代碼:自動為會議請求插入簽名:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim xMeetingItem As Outlook.MeetingItem
Dim xFSO As Scripting.FileSystemObject
Dim xSignStream, xWriteStream, xReadStream As Scripting.TextStream
Dim xSignFld, xSignSubFld As Scripting.Folder
Dim xSignFile As Scripting.File
Dim xSignText, xSignPath As String
Dim xMailRTFText, xMeetingRTFText, xAllRTFText As String
Dim xByte() As Byte
Dim xPos As Integer
Dim xFilePath, xFldPath, xFldName As String
Dim xMailItem As MailItem
On Error Resume Next
If Item.Class = olMeetingRequest Then
    Set xMeetingItem = Item
    Set xFSO = CreateObject("scripting.FileSystemObject")
    xSignPath = CStr(Environ("USERPROFILE")) & "\AppData\Roaming\Microsoft\Signatures\"
    Set xSignFld = xFSO.GetFolder(xSignPath)
    If xSignFld.SubFolders.Count <> 0 Then
        For Each xSignSubFld In xSignFld.SubFolders
            xFldName = xSignSubFld.Name
            xFldPath = xSignSubFld.Path
        Next
    End If
    For Each xSignFile In xSignFld.Files
        If xFSO.GetExtensionName(xSignFile.Path) = "htm" Then
            Set xSignStream = xFSO.OpenTextFile(xSignFile.Path)
            xSignText = xSignStream.ReadAll
            If InStr(xSignText, xFldName) <> 0 Then
                xSignText = Replace(xSignText, xFldName, xFldPath)
            End If
            Set xMailItem = Outlook.Application.CreateItem(olMailItem)
            xMailItem.HTMLBody = xSignText
            xMailRTFText = StrConv(xMailItem.RTFBody, vbUnicode)
            xMeetingRTFText = StrConv(xMeetingItem.RTFBody, vbUnicode)
            xPos = InStrRev(xMeetingRTFText, "{\*\htmltag104 </div>}\htmlrtf }\htmlrtf0")
            xFilePath = CreateObject("WScript.Shell").SpecialFolders(16)
            xFilePath = xFilePath & "\MeetingText.txt"
            If xFSO.FileExists(xFilePath) Then
                xFSO.DeleteFile xFilePath
            End If
            Set xWriteStream = xFSO.OpenTextFile(xFilePath, 8, True)
            xMeetingRTFText = Mid(xMeetingRTFText, 1, xPos - 1) & "{\*\htmltag72 </p>}{\*\htmltag0 \par }{\*\htmltag0 \par }" _
            & "{\*\htmltag64 <p class=MsoNormal>}\htmlrtf {\htmlrtf0 {\*\htmltag148 <span lang=EN-US style='color:#00B050'>}\htmlrtf {\htmlrtf0" _
            & "{\*\htmltag244 <o:p>}{\*\htmltag84 &nbsp;}\htmlrtf \'a0\htmlrtf0{\*\htmltag252 </o:p>}" _
            & "{\*\htmltag156 </span>}\htmlrtf }\htmlrtf0 \htmlrtf\par}\htmlrtf0" _
            & vbCrLf & xMailRTFText & vbCrLf & Mid(xMeetingRTFText, xPos, Len(xMeetingRTFText) - xPos + 1)
            xWriteStream.WriteLine xMeetingRTFText
            Set xReadStream = xFSO.OpenTextFile(xFilePath)
            xAllRTFText = xReadStream.ReadAll
            PackBytes xByte, xAllRTFText
            xMeetingItem.RTFBody = xByte
            xMeetingItem.Save
            xMailItem.Close olDiscard
        End If
    Next
End If
End Sub
Private Sub PackBytes(ByteArray() As Byte, ByVal PostData As String)
    ByteArray() = StrConv(PostData, vbFromUnicode)
End Sub

doc自動將信號插入會議6

3。 然後保存並關閉代碼窗口,此後,當您發送外向會議邀請時,將自動插入特定的簽名。 你可以去 發送項目 文件夾檢查結果:

doc自動將信號插入會議7


最佳辦公生產力工具

Kutools for Outlook - 超過 100 種強大的功能可增強您的 Outlook

🤖 人工智慧郵件助手: 具備人工智慧魔力的即時專業電子郵件——一鍵天才回覆、完美語調、多語言掌握。輕鬆改變電子郵件! ……

📧 電子郵件自動化: 外出(適用於 POP 和 IMAP)  /  安排發送電子郵件  /  發送電子郵件時按規則自動抄送/密件副本  /  自動轉送(進階規則)   /  自動添加問候語   /  自動將多收件者電子郵件拆分為單獨的訊息 ...

📨 電子郵件管理: 輕鬆回憶電子郵件  /  按主題和其他人阻止詐騙電子郵件  /  刪除重複的電子郵件  /  進階搜索  /  合併資料夾 ...

📁 附件專業版批量保存  /  批量分離  /  批量壓縮  /  自動保存   /  自動分離  /  自動壓縮 ...

🌟 介面魔法: 😊更多又漂亮又酷的表情符號   /  使用選項卡式視圖提高 Outlook 工作效率  /  最小化 Outlook 而不是關閉 ...

👍 一鍵奇蹟: 使用傳入附件回覆全部  /   反網路釣魚電子郵件  /  🕘顯示寄件者的時區 ...

👩🏼‍🤝‍👩🏻 通訊錄和行事曆: 從選定的電子郵件中大量新增聯絡人  /  將聯絡人群組拆分為各組  /  刪除生日提醒 ...

超過 100特點 等待您的探索! 按此處了解更多。

閱讀更多       免費下載      購買
 

 

Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Dear Supporter,

Regarding to VBA "hack", in Outlook365 does not insert the default signature at the end of a neither a new meeting nor appointment. What should I change in the code to get it work?

Thank you in advance.

Best regards: Laszlo
This comment was minimized by the moderator on the site
What lines do I need to change to get this to work on my own profile? I've added the string to my signature location.
Automatically Insert Signature To Outlook Meeting Requests With VBA Code
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations