Log in

View Full Version : [SOLVED:] Extracting email addresses and path folder they are saved in



Vulcain
01-17-2019, 08:19 AM
Hello,

I've been searching on the forum how to extract all email addresses in my outlook and the folder path they are saved in.
I've found multiple solutions to extract the email addresses (VBA or applications) but I've never been able to extract the folder path.

I'll explain, what I'm trying to do.
We have a folder, full of subfolders with email form our clients and we would like to export the email addresses with the folder path where the message was found in a csv or something usefull.
We found solutions to extract every emails addresses from each subfolders but there is never any indication of the folder they were found.
Does anyone would have a solution?

Thank you very much. (Sorry my english is not perfect)

skatonni
01-17-2019, 11:16 AM
If you have the item you can work out the folder path.


Option Explicit

Sub GetItemsFolderPath()

' http://vboffice.net/sample.html?lang=en&mnu=2&smp=65&cmd=showitem

Dim obj As Object
Dim F As Folder
Dim Msg As String

Set obj = ActiveWindow

If TypeOf obj Is Inspector Then
Set obj = obj.currentItem
Else
Set obj = obj.Selection(1)
End If

Set F = obj.Parent

Msg = "The path is: " & F.FolderPath & vbCrLf
Msg = Msg & "Switch to the folder?"

If MsgBox(Msg, vbYesNo) = vbYes Then
Set ActiveExplorer.CurrentFolder = F
End If

End Sub

Vulcain
01-17-2019, 12:03 PM
Thank you for your help.
I've found a solution using the code on the page there: https://www.developpez.net/forums/blogs/191381-oliv/b4653/exportation-hyper-rapide-infos-emails-vers-excel/
Comments are in French, but it could be useful to others.