跳到主要內容

如何始終從Outlook中的特定帳戶發送新電子郵件?

假設您在 Outlook 中創建了多個電子郵件帳戶,在 Outlook 中發送電子郵件時,“發件人”字段中顯示的電子郵件帳戶取決於您當前所在的帳戶。無論您當前在哪個帳戶,您都希望始終發送新的來自特定電子郵件帳戶的電子郵件,以下教程可以幫助您,本教程中的方法可以幫助您。

始終使用VBA代碼從特定帳戶發送新電子郵件

Office 標籤 - 在 Microsoft Office 中啟用選項卡式編輯和瀏覽,讓工作變得輕而易舉
Kutools for Outlook - 透過 100 多個進階功能增強 Outlook,實現卓越效率
使用這些進階功能增強您的 Outlook 2021 - 2010 或 Outlook 365。 享受全面的 60 天免費試用並提升您的電子郵件體驗!

箭頭藍色右氣泡始終使用VBA代碼從特定帳戶發送新電子郵件

此VBA代碼可以幫助您輕鬆地從Outlook中的特定帳戶發送新電子郵件。 請執行以下操作。

1.請按 其他 + F11 打開 Microsoft Visual Basic for Applications 對話框。

2。 展開 Project1 > Microsoft Outlook對象 通過雙擊它們。 然後雙擊 本次展望會議 打開 Vba工程.OTM 對話框。

3.複製下面的VBA代碼並將其粘貼到對話框中。

VBA:始終從特定帳戶發送新電子郵件。

Public Sub NewBySpecAccount()
Dim oAccount As Outlook.Account
Dim oMail As Outlook.MailItem
For Each oAccount In Application.Session.Accounts
If oAccount.DisplayName = "Your account name" Then
    Set oMail = Application.CreateItem(olMailItem)
    oMail.SendUsingAccount = oAccount
    oMail.Display
End If
Next
End Sub

4.現在,您需要更改“您的帳號”發送到您希望始終發送新電子郵件的電子郵件帳戶。 看截圖:

5.然後按 F5 鍵盤上的鍵運行VBA代碼。

6.運行VBA代碼後, 您的留言 窗口將會彈出,請撰寫您的電子郵件並單擊 送出 按鈕發送。

備註:此VBA代碼已在Outlook 2007、2010和2013中成功測試,但未在Exchange 2007和2010中執行。

 


最佳辦公生產力工具

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
This code does not work if you have multiple Exchange accounts defined in your profile - pointing to different exchange servers.

In that case you need a variation on this code from Microsoft.

https://learn.microsoft.com/en-us/office/vba/outlook/concepts/accounts/create-a-sendable-item-for-a-specific-account-based-on-the-current-folder-outloo
This comment was minimized by the moderator on the site
Hi, the "VBA: always send a new email from specific account." does not work. If you want to send email from Excel, you have to change Outlook settings. Outlook - File - Account settings. Here you have to prioritise different email and different datafiles you have access to besides your usual account (email). This will work even if Outlook is closed then. (W10, O365)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations