Getting access to Contacts Folder

Add-in Express™ Support Service
That's what is more important than anything else

Getting access to Contacts Folder
 
Humberto Aicardi




Posts: 3
Joined: 2006-04-03
Hi,

I was using Turbo Power Office Partner to get access to Outlook Contacts Folder, is there a way to get access to this folder using Add In Express VCL? If so, how?

Regards,
Humberto Aicardi
Posted 03 Apr, 2006 07:52:19 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Humberto,

See the sample code below:


procedure TAddInModule.adxCOMAddInModuleAddInInitialize(Sender: TObject);
var
  i: Integer;
  IContact: _ContactItem;
  IContactFolder: MAPIFolder;
begin
  IContactFolder := OutlookApp.GetNamespace('MAPI').GetDefaultFolder(olFolderContacts);
  if Assigned(IContactFolder) then
    try
      for i := 1 to IContactFolder.Items.Count do begin
        IContactFolder.Items.Item(i).QueryInterface(IID__ContactItem, IContact);
        if Assigned(IContact) then
          try
            // TODO
          finally
            IContact := nil;
          end;
      end;
    finally
      IContactFolder := nil;
    end;
end;


Posted 03 Apr, 2006 10:13:48 Top