Get User Exchange phone extension

Status
Not open for further replies.

Binocular222

New Member
Outlook version
Email Account
Exchange Server
The below code display info on selected contact (contact is store in Exchange server and GAL). However, I cannot figure out how to get phone extension, please anyone could help?
Code:
Public Sub testing()
On Error Resume Next
Set DummyEmail = CreateObject("Outlook.Application").CreateItem(olMailItem)            'Create a dummy e-mail to add aliases to
Set Selection = Application.ActiveExplorer.Selection

For Each ContactItem In Selection
    With ContactItem
       If .Email1AddressType = "EX" Then
          Set ActivePersonRecipient = DummyEmail.Recipients.Add(.Account & "@kpmg.com.vn")      'Use the .Account alias to create a recipient object and add it to the dummy e-mail
          If ActivePersonRecipient.Resolve Then                                      'If valid, use the  AddressEntry property of the recipient to return an AddressEntry object
             Set oExUser = ActivePersonRecipient.AddressEntry.GetExchangeUser                   'Use the GetExchangeUser method of the AddressEntry object to retrieve the ExchangeUser object for the recipient.
             If Trim(oExUser.Address) <> "" Then                                             'To counter weird error when sometime ActivePersonRecipient.Resolve to True even if the Exchange account doesn't exist.
                resultstr = oExUser.FirstName
                MsgBox (resultstr)
             End If
          End If
        End If
    End With
Err.Clear
Next

Set AllContactItems = Nothing
End Sub
 

Binocular222

New Member
Outlook version
Email Account
Exchange Server
Yes, I tried that, but only result in office phone number without extension.
 

Alexander Kuzin

New Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
Hello! Did you find out how to retrieve extension number? I need it too.
Thanks.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Exchange 2013 On premise set MessageRateLimit for User has no effect. Exchange Server Administration 0
William Yeack Outlook/Exchange - Changing display of “From” user Using Outlook 3
R Exchange - Locating a user that has log files but is not found using powershell Exchange Server Administration 1
F Exchange User Information - Notes Exchange Server Administration 4
A give User Read Only access to secondary mailbox in Exchange 2010 via AD Exchange Server Administration 1
J Cannot copy outlook form to mailbox of exchange 2k13 user Exchange Server Administration 1
J Exchange user showing in auto-complete Exchange Server Administration 10
R Can BCM use Public Folders and Exchange for multi-user/ BCM (Business Contact Manager) 1
J How to create a drop down user defined field that will appear on an inbox view Outlook VBA and Custom Forms 8
J VBA Cannot programmatically input or change Value for User Defined field Using Outlook 1
Z Import Tasks from Access Using VBA including User Defined Fields Outlook VBA and Custom Forms 0
icacream Outlook 2016 “Enter your user name and password for the following server.” Using Outlook 5
N Item cannot be saved because it was modified by another user or window, and, Item could not be moved... Using Outlook 0
A How to stop user form from disapearing once mail window is closed? Outlook VBA and Custom Forms 0
H Information from user defined field into Excel Outlook VBA and Custom Forms 7
D Outlook 2010 Outlook in Windows 10 keeps asking for user name and password repeatedly Using Outlook 14
E Asking user to select multiple options in a list in an email Outlook VBA and Custom Forms 0
icacream Enter your user name and password for the following server. Using Outlook 4
B User defined field for messages with 'me' in the [To], [Cc] line Using Outlook 0
S User Defined Fields adding new value (2) Using Outlook 0
R Creating a user defined function Outlook VBA and Custom Forms 3
M Compile error: User-defined type not defined Outlook VBA and Custom Forms 0
M How to export Voting Results with user names and their responses Outlook VBA and Custom Forms 13
M vCard does not have user-defined fields from my custom contact form (365) Using Outlook 1
C Outlook 2016 Conditional Format for User Defined Field Using Outlook 1
G <mailto:user@domain.com<mailto:user@domain.com<mailto:user@domain.com>>> Using Outlook 5
F MAPI, User Defined Fields and perspective after 20 years Outlook VBA and Custom Forms 0
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
A Created a new user account and the local account cannot see email Using Outlook 3
N How to set automatically the default or user defined Quickstyle Templates by Answer in Outlook Using Outlook 1
S Custom Form, copy user field data to message body Outlook VBA and Custom Forms 12
Daniel Schunk User-defined form arrives empty at the recipient Using Outlook 3
C Changed By field not displaying individual user's name in O365 Shared Mailbox Using Outlook 9
M other user's mailbox won't open, forms disappeared Using Outlook 42
S Custom user fields in received messages Outlook VBA and Custom Forms 1
T Have Outlook 2016 suggest email address auto complete entries directly from the user's contacts list Using Outlook 10
T Have Outlook 2016 suggest email address auto complete entries directly from the user's contacts list Using Outlook 0
Potty Ash MS Outlook 2010 custom form - validation or formula to request user to check a checkbox Outlook VBA and Custom Forms 16
P Change PC User Directory & iPhone Sync Using Outlook 2
J Assess content of User Defined Field in Rule Using Outlook 3
M How can I determine which user read an email Exchange Server Administration 4
J reinstalling Outlook 2007 asking for user name & password Using Outlook 14
R Prompt asking the user to send email to folder as *.msg file Outlook VBA and Custom Forms 1
J Outlook - 2013 - Error msg when copying folders from Online Archives to another user's mailbox Using Outlook 0
N Select a folder in a user account Outlook VBA and Custom Forms 2
S Outlook User defined date field (UDF) not syncing Using Outlook 2
A How to enable outlook room finder (outlook connector (mapi)) user ? Using Outlook 3
M Multiple User Defined Fields that can be added, changed, updated using VBA and user form Outlook VBA and Custom Forms 0
R User Defined Fields adding new value Using Outlook 3
B ActiveExplorer return NULL on new Window user login and running Outlook first time Using Outlook 1

Similar threads

Top