Outlook 2010 Retrieve data from GAL and put it in Clipboard

Martin69

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Hello,

Hello,

i have already a script that works fine - but i would like to habe a few changes.

the script displays an outlook contact, that was searched by the email adress.

Now i want the following changes:

1) get some Information out of the selected item e.g. department

2) this Information should automatically put in the clipboard

Can somebody help me - thank you!

Sub DisplayAddressEntryDetails(oM As MailItem)
Dim oPA As Outlook.PropertyAccessor
Dim oContact As Outlook.ContactItem
Dim oSender As Outlook.AddressEntry
Dim SenderID As String

'Create an instance of PropertyAccessor
Set oPA = oM.PropertyAccessor

'Obtain PidTagSenderEntryId and convert to string
SenderID = oPA.BinaryToString _
(oPA.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0C190102"))

'Obtain AddressEntry Object of the sender
Set oSender = Application.Session.GetAddressEntryFromID(SenderID)

'Examine AddressEntryUserType
If oSender.AddressEntryUserType = olOutlookContactAddressEntry Then
'Obtain ContactItem for AddressEntry
Set oContact = oSender.GetContact
oContact.Display
'Display details for Exchange or SMTP sender
Else
oSender.Details

End If
 
Top