control to get Outlook contacts - InfoPath Dev
in

InfoPath Dev

control to get Outlook contacts

Last post 10-19-2005 08:57 PM by franck. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-19-2005 07:46 PM

    control to get Outlook contacts

    Gday,

    Just wondering whether it's possible to have a button on the form, when clicked it will open a dialog box which will contain all of the users outlook contacts? Probably not? any work arounds?

    Regards
  • 10-19-2005 08:57 PM In reply to

    Re: control to get Outlook contacts

    Hi,

    You can maybe do it with C# behind your form.
    You would need a Ref to the Microsoft Outlook Object Library

    then:
    Outlook._Application outlook = new Outlook.ApplicationClass();
    Outlook.NameSpace ns = outlook.GetNamespace("MAPI");
    Outlook.MAPIFolder cf = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
    Outlook.Items ctcItems = cf.Items;
    Outlook.ContactItem ctc;
    for(int j = 1; j < (ctcItems.Count + 1); j++)
    {
    ctc = (Outlook.ContactItem) ctcItems.Item(j);
    // do something with the contact.
    }

    Hope that it helps.


    Regards,

    Franck Dauché
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.