Hey there,
I would appreciate your support to help me on an issue that I have been trying to solve but unfortunately I couldn't reach to the expected resolution. Whereby, I’m trying to retrieve the current DB user’s information from outlook and I've successfully managed to retrieve the basic contact information such as the email address, name, manager, position, office location..etc. The issue is that I would like to retrieve the contact’s photo in outlook to be shown on the user form either by image object or smoothing. (similar to SharePoint)
And here is the code that I tried to use but I get an error with the last line. this code is placed on load event and I'm using a late binding to prevent compatibility issues.
Thanks in advance.
Best,
I would appreciate your support to help me on an issue that I have been trying to solve but unfortunately I couldn't reach to the expected resolution. Whereby, I’m trying to retrieve the current DB user’s information from outlook and I've successfully managed to retrieve the basic contact information such as the email address, name, manager, position, office location..etc. The issue is that I would like to retrieve the contact’s photo in outlook to be shown on the user form either by image object or smoothing. (similar to SharePoint)
And here is the code that I tried to use but I get an error with the last line. this code is placed on load event and I'm using a late binding to prevent compatibility issues.
Code:
Dim OL, olAllUsers, oExchUser, oentry, myitem As Object
Dim User As String
Set OL = CreateObject("outlook.application")
Set olAllUsers = OL.Session.AddressLists.Item("All Users").AddressEntries
User = OL.Session.CurrentUser.Name
Set oentry = olAllUsers.Item(User)
Set oExchUser = oentry.GetExchangeUser()
MsgBox oExchUser.PrimarySmtpAddress 'works fine, this is to get the email address.
Me.Image01 = oExchUser.StdPicture
Thanks in advance.
Best,
Last edited: