none
Outlook Contact Item - Show Image in notes section using C# RRS feed

  • Question

  • Hi, 

    I am currently using the   Microsoft.Office.Interop.Outlook

    to generate the Outlook Contact through C# program.

    now I wanted to show the image (i.e show the actual image in the notes section)

    I am trying to achieve it but somehow I am only able to attach it

    Please refer to attached screenshot

    aNeed actual output like this -

    Sample Code I am using

      OutLook._Application outlookObj = CheckForOutlookInstance();
                    var fldContacts =
                        (OutLook.MAPIFolder)outlookObj.Session.GetDefaultFolder(OutLook.OlDefaultFolders.olFolderContacts);
                    var newContact = (OutLook.ContactItem)fldContacts.Items.Add(OutLook.OlItemType.olContactItem);
      newContact.FirstName = "";
                    newContact.LastName = "";
                    newContact.Body = "test photo";
    newContact.Attachments.Add(contactphotoPath);

      private OutLook._Application CheckForOutlookInstance()
            {
                var processes = Process.GetProcessesByName("OUTLOOK");
    
                var collCount = processes.Length;
    
                if (collCount != 0)
                {
                    _outlookObj = (OutLook._Application) Marshal.GetActiveObject("Outlook.Application");
                    return _outlookObj;
                }
    
                _outlookObj= new OutLook.Application();
                return _outlookObj;
    
            }


    Monday, July 8, 2019 10:26 AM

All replies

  • Hi,

    Since this forum is discussing about the General Windows Desktop Development Issues.

    However this thread is C# related, I will move it to Visual C# forum.

    Best regards,

    Drake


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, July 9, 2019 1:44 AM
  • Thanks Drake,

    hope someone will answer

    Tuesday, July 9, 2019 5:20 AM
  • Hi tan_vis0,

    Thank you for posting here.

    Based on my search, I could not find a way to make it. I suggest that you could submit a feature request in the following link.

    https://developercommunity.visualstudio.com/spaces/61/index.html

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, July 9, 2019 9:03 AM
    Moderator