Vinzz
Vinzz

Reputation: 4028

Outlook VSTO is it possible to use the address book control?

I need to mimic the adress book control in an Outlook VSTO project. It would be much simpler to use the real control, isn't it?

So, do you know a way to expose the address book control, and get what's selected within, of course?

Edit: Never mind, re-creating a basic version of the control will be way easyer.

Upvotes: 1

Views: 654

Answers (2)

Vinzz
Vinzz

Reputation: 4028

Solution: third party Redemption library offer this feature.

RedemptionLoader.RDOSession.AddressBook.ShowAddressBook(...)

Upvotes: 2

leora
leora

Reputation: 196539

You don't need to use a third party addin. you can do it with this:

http://msdn.microsoft.com/en-us/library/office/ff868361.aspx

this code below is in VBA but you can easily convert it to C#:

Sub SelectRecipients() 
Dim oMsg As MailItem 
Set oMsg = Application.CreateItem(olMailItem) 
Dim oDialog As SelectNamesDialog 
Set oDialog = Application.Session.GetSelectNamesDialog 
With oDialog 
.InitialAddressList = _ 
Application.Session.GetGlobalAddressList 
.Recipients = oMsg.Recipients 
 If .Display Then 
 'Recipients Resolved 
 oMsg.Subject = "Hello" 
 oMsg.Send 
 End If 
 End With 
End Sub 

Upvotes: 0

Related Questions