如何在vba outlook中获取邮件发件人[关闭]

问题描述 投票:-2回答:1

vba中是否有任何函数可以返回电子邮件的发件人?

vba access-vba
1个回答
1
投票

当你在这里得到一些代码时,我会留意这个。但现在...

Sub GetSendor()

Dim oApp As New Outlook.Application
Dim oMail As Outlook.MailItem
Dim nm As Namespace

Set nm = oApp.GetNamespace("MAPI")
Set oMail = nm.GetDefaultFolder(olFolderInbox).Folders.Item(1).Items.GetLast

oMail.SenderEmailAddress

End Sub

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.