跳到主要内容

如何始终从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应用程序 对话框。

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