none
How to display contact information tooltip from an Outlook Add In RRS feed

  • Question

  • Hello,

    I'm in charge of developing C# Outlook Add In for customization of appointments.

    In a custom view the selected attendees are been displayed. When the user click on the attendee item I need to show contact information in a the same way how it is displayed in Outlook when the user hover the recipient name.

    Thank you!

    • Edited by ivaylo b Tuesday, March 31, 2015 10:53 AM
    Tuesday, March 31, 2015 10:50 AM

Answers

  • You can create a similar form using WPF controls. Unfortunately the Outlook object model doesn't provide anything for displaying such windows.
    Tuesday, March 31, 2015 12:21 PM

All replies

  • Hello,

    Do you want to know what controls to use to create such form?

    Anyway, the Outlook object model doesn't provide anything for displaying such popups programmatically.

    You can use the Display method of the ContactItem class to display a new Inspector object for the item.

    Tuesday, March 31, 2015 10:59 AM
  • Thanks, for reply,

    It is interesting to know what kind of form it is used for displaying it.

    You are right using a ContactItem class, it is possible to Display Contact Form, but it looks not the same as the tooltip.

    There is my method:

     private void ShowContactCard()
            {
                Outlook.NameSpace ns = null;
                Outlook.MAPIFolder contactsFolder = null;
                Outlook.Items items = null;
                Outlook.ContactItem contact = null;
              
                try
                {
                    ns = outlookApp.GetNamespace("MAPI");
                    contactsFolder = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
                    items = contactsFolder.Items;
                    contact = items.GetFirst();
                    contact.Display(true);
                }
                catch (Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message);
                }
                finally
                {
                    if (contact != null) Marshal.ReleaseComObject(contact);
                    if (items != null) Marshal.ReleaseComObject(items);
                    if (contactsFolder != null) Marshal.ReleaseComObject(contactsFolder);
                    if (ns != null) Marshal.ReleaseComObject(ns);
                }
            }


    Ivailo Bahchevanov

    Tuesday, March 31, 2015 12:18 PM
  • You can create a similar form using WPF controls. Unfortunately the Outlook object model doesn't provide anything for displaying such windows.
    Tuesday, March 31, 2015 12:21 PM