Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub GetALLEmailAddresses()
- Dim objFolder As MAPIFolder
- Dim strEmail As String
- Dim strEmails As String
- ''' Requires reference to Microsoft Scripting Runtime
- Dim dic As New Dictionary
- Dim objItem As Object
- ''Set objFolder = Application.ActiveExplorer.Selection
- Set objFolder = Application.GetNamespace("Mapi").PickFolder
- For Each objItem In objFolder.Items
- If objItem.Class = olMail Then
- strEmail = objItem.SenderEmailAddress
- If Not dic.Exists(strEmail) Then
- strEmails = strEmails + strEmail + vbCrLf
- dic.Add strEmail, ""
- End If
- End If
- Next
- Debug.Print strEmails
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement