Programmatically accessing “Offline Address book” using Redemption

混江龙づ霸主 提交于 2019-12-06 05:29:33
Jojo Sardez

Try this. I am using Redemption 4.6. I created a form and added a DataGridView for result viewing purpose. Here is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TestingJojoWinForms
{
public partial class frmRedemption : Form
{
    public frmRedemption()
    {
        InitializeComponent();
    }

    private void frmRedemption_Load(object sender, EventArgs e)
    {
        DataTable dtResult = new DataTable("Result");
        dtResult.Columns.Add("EntryID");
        dtResult.Columns.Add("FirstName");
        dtResult.Columns.Add("LastName");
        dtResult.Columns.Add("Alias");
        dtResult.Columns.Add("SMTPAddress");
        dtResult.Columns.Add("JobTitle");
        dtResult.Columns.Add("Address");
        dtResult.Columns.Add("StreetAddress");

        Redemption.RDOSessionClass session = new Redemption.RDOSessionClass();
        session.Logon(@"your_account_name", "your_password", false, false, 0, false);
        for(int index = 1; index <= session.AddressBook.GAL.AddressEntries.Count; index++) 
        {
            Redemption.RDOAddressEntryClass entry = (Redemption.RDOAddressEntryClass)session.AddressBook.GAL.AddressEntries.Item(index);
            dtResult.Rows.Add(entry.EntryID, entry.FirstName, entry.LastName, entry.Alias, entry.SMTPAddress, entry.JobTitle, entry.Address, entry.StreetAddress);
        }
        session.Logoff();

        this.dataGridView1.DataSource = dtResult;
    }


}
}

The result will be like this:

Sorry it's not much of an answer but I'd drop Dmitry Streblechenko (the developer of the Redemption library) an email - he's always been quick to respond and very helpful.

His email address is on the Redemption website: http://www.dimastr.com/redemption/

It would be helpful to be more specific in your question.

The "offline address book" is automatically managed by Outlook as a cached copy of the Global Address list of Exchange, see KB article.

If you need access to an element of the address book, use the SafeContact object from Redemption. The fact that Oulook cached the contact information should be transparent to the user.

There is not much to be done in the UI of Outlook regarding the offline address book. Does your question mean to programmatically trigger an update of the address book ? Like, in Outlook 2010, in the Send/Receive tab, Send & Receive group, Send/Receive Groups drop-down, download address book ?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!