本文介绍了MS Access VBA:通过 Outlook 发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用 MS Access VBA 通过帐户发送电子邮件?我知道这个问题很模糊,但很难在网上找到不以某种方式过时的相关信息.
How can I send an email through an account using MS Access VBA? I know this question is vague but it's so hard to find the relevant information online that isn't outdated in some way.
我并不是要对那些回答的人无礼,但是我使用的是 MS Access.我无法在 Outlook VBA 中编写实际代码.
I don't mean to be rude to those who are answering, but I am using MS Access. I cannot write the actual code in Outlook VBA.
推荐答案在 Visual Basic 编辑器中添加对 Outlook 对象模型的引用.然后您可以使用下面的代码使用 Outlook 发送电子邮件.
Add a reference to the Outlook object model in the Visual Basic editor. Then you can use the code below to send an email using outlook.
Sub sendOutlookEmail() Dim oApp As Outlook.Application Dim oMail As MailItem Set oApp = CreateObject("Outlook.application") Set oMail = oApp.CreateItem(olMailItem) oMail.Body = "Body of the email" oMail.Subject = "Test Subject" oMail.To = "Someone@somewhere" oMail.Send Set oMail = Nothing Set oApp = Nothing End Sub更多推荐
MS Access VBA:通过 Outlook 发送电子邮件
发布评论