I’m using VBA in Outlook 2010 and I’m trying to create a function that will retrieve a selected user Home folder path from Active Directory.
The following code is a simple pop up that has the saving destination.
Sub SaveSelected()
'Declaration
Dim myItems, myItem, myAttachments, myAttachment
Dim myOrt As String
Dim myOLApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
Dim objFSO As Object
Dim intCount As Integer
'Ask for destination folder
myOrt = InputBox("Destination", "Save Attachments", "\\server\home\VARIABLE\")
End Sub
I want the VARIABLE to come from AD depending on the currently selected email.
for example I received an email from Jimmy@home.com and then I select the email from jimmy@home.com, I want to be able to retrieve
\server\homedirectory\jimmy
and use “jimmy” as my VARIABLE.
If this is possible any help would be greatly appreciated.

THe follow code works