Outlook의 하나 이상의 이메일에서 보낸 사람의 이메일 주소를 얻는 방법은 무엇입니까?
Outlook에서 하나 이상의 수신 이메일의 "보낸사람" 필드에서 이메일 주소를 추출하려고 시도한 적이 있습니까? 이 문서에서는 이 작업을 처리하는 데 도움이 되는 VBA 코드를 제공합니다.
Outlook의 하나 이상의 전자 메일에서 보낸 사람의 전자 메일 주소 가져오기
다음 VBA 코드를 실행하여 Outlook에서 수신된 하나 이상의 이메일의 "보낸사람" 필드에서 이메일 주소를 추출하십시오.
1. 전자 메일 폴더를 열고 보낸 사람의 전자 메일 주소를 가져올 전자 메일 메시지를 선택합니다. 눌러 다른 + F11 키를 눌러 응용 프로그램 용 Microsoft Visual Basic 창.
팁: 여러 이메일을 선택하려면 Ctrl 키 키를 누른 다음 이메일을 하나씩 선택합니다.
2. 에서 응용 프로그램 용 Microsoft Visual Basic 창을 클릭합니다 끼워 넣다 > 모듈, 다음 VBA 코드를 모듈(코드) 창에 복사합니다.
VBA 코드: Outlook의 하나 이상의 이메일에서 보낸 사람의 이메일 주소 추출
Sub GetSmtpAddressOfSelectionEmail()
Dim xExplorer As Explorer
Dim xSelection As Selection
Dim xItem As Object
Dim xMail As MailItem
Dim xAddress As String
Dim xFldObj As Object
Dim FilePath As String
Dim xFSO As Scripting.FileSystemObject
On Error Resume Next
Set xExplorer = Application.ActiveExplorer
Set xSelection = xExplorer.Selection
For Each xItem In xSelection
If xItem.Class = olMail Then
Set xMail = xItem
xAddress = xAddress & VBA.vbCrLf & " " & GetSmtpAddress(xMail)
End If
Next
If MsgBox("Sender SMTP Address is: " & xAddress & vbCrLf & vbCrLf & "Do you want to export the address list to a txt file? ", vbYesNo, "Kutools for Outlook") = vbYes Then
Set xFldObj = CreateObject("Shell.Application").BrowseforFolder(0, "Select a Folder", 0, 16)
Set xFSO = New Scripting.FileSystemObject
If xFldObj Is Nothing Then Exit Sub
FilePath = xFldObj.Items.Item.Path & "\Address.txt"
Close #1
Open FilePath For Output As #1
Print #1, "Sender SMTP Address is: " & xAddress
Close #1
Set xFSO = Nothing
Set xFldObj = Nothing
MsgBox "Address list has been exported to:" & FilePath, vbOKOnly + vbInformation, "Kutools for Outlook"
End If
End Sub
Function GetSmtpAddress(Mail As MailItem)
Dim xNameSpace As Outlook.NameSpace
Dim xEntryID As String
Dim xAddressEntry As AddressEntry
Dim PR_SENT_REPRESENTING_ENTRYID As String
Dim PR_SMTP_ADDRESS As String
Dim xExchangeUser As exchangeUser
On Error Resume Next
GetSmtpAddress = ""
Set xNameSpace = Application.Session
If Mail.sender.Type <> "EX" Then
GetSmtpAddress = Mail.sender.Address
Else
PR_SENT_REPRESENTING_ENTRYID = "http://schemas.microsoft.com/mapi/proptag/0x00410102"
xEntryID = Mail.PropertyAccessor.BinaryToString(Mail.PropertyAccessor.GetProperty(PR_SENT_REPRESENTING_ENTRYID))
Set xAddressEntry = xNameSpace.GetAddressEntryFromID(xEntryID)
If xAddressEntry Is Nothing Then Exit Function
If xAddressEntry.AddressEntryUserType = olExchangeUserAddressEntry Or xAddressEntry.AddressEntryUserType = olExchangeRemoteUserAddressEntry Then
Set xExchangeUser = xAddressEntry.GetExchangeUser()
If xExchangeUser Is Nothing Then Exit Function
GetSmtpAddress = xExchangeUser.PrimarySmtpAddress
Else
PR_SMTP_ADDRESS = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"
GetSmtpAddress = xAddressEntry.PropertyAccessor.GetProperty(PR_SMTP_ADDRESS)
End If
End If
End Function
3. 클릭 도구 > 참조확인 후 Microsoft 스크립팅 런타임 상자에 참조 – 프로젝트1 대화 상자.
4. 누르세요 F5 코드를 실행하는 키입니다. 그 다음에 Outlook 용 Kutools 선택한 이메일의 모든 발신인 이메일 주소를 나열하는 대화 상자가 나타납니다.
팁:
5. 클릭 후 가능 버튼, a 폴더 찾아보기 대화 상자가 나타납니다. 파일을 저장할 폴더를 선택하고 OK 버튼을 클릭합니다.
6. 마지막으로 Outlook 용 Kutools 내보낸 파일의 경로를 알려주는 대화 상자가 나타납니다. 딸깍 하는 소리 OK 그것을 닫습니다.
7. 내보낸 파일이 저장된 폴더로 이동하여 .txt 파일을 엽니다. 주소 선택한 이메일의 보낸 사람 이메일 주소를 보려면
Outlook 용 Kutools-Outlook에 100 개의 고급 기능을 제공하고 작업을 훨씬 더 쉽게 만듭니다!
- 자동 CC / BCC 이메일을 보낼 때 규칙에 따라; 자동 전달 사용자 정의에 의한 여러 이메일; 자동 회신 교환 서버없이 더 많은 자동 기능 ...
- BCC 경고 -모두 답장하려고 할 때 메시지 표시 메일 주소가 숨은 참조 목록에있는 경우; 첨부 파일 누락시 알림및 기타 알림 기능 ...
- 메일 대화에서 모든 첨부 파일로 (전체) 회신; 많은 이메일에 답장 초 안에; 인사말 자동 추가 대답 할 때; 제목에 날짜 추가 ...
- 첨부 도구 : 모든 메일의 모든 첨부 파일 관리, 자동 분리, 모두 압축, 모두 이름 바꾸기, 모두 저장 ... 빠른 보고서, 선택한 메일 수...
- 강력한 정크 메일 관습에 의해; 중복 메일 및 연락처 제거... Outlook에서 더 스마트하고 빠르며 더 나은 작업을 수행 할 수 있습니다.

