none
How to know, if message is having Inline attachments, Separate Attachments or Both kind of attachments using EWS Managed API 2.0 in C# RRS feed

  • Question

  • Environment:  -

    Exchange Server: - Exchange Server 2010 SP3

    EWS API: - 2.0

    IDE: - Visual Studio 2008

    Language: - C#

    .

    Requirement: -

    How to know, if message is having following, using EWS Managed API 2.0 in C#

    1. Inline attachments
    2. Separate Attachments
    3. Both kind of attachments

    Kindly assist

    .

    I will be really thankful.


    Regards, S.P Singh

    Monday, August 3, 2015 5:27 AM

Answers

  • Please see

    https://msdn.microsoft.com/en-us/library/office/dd633665(v=exchg.80).aspx

    Thanks,
    Venkat

    Monday, August 3, 2015 3:45 PM
  • var inbox = new FolderId(WellKnownFolderName.Inbox);

    var iv = new ItemView(10);

    var items = service.FindItems(inbox,iv);

    int itemsCountInInbox = items.TotalCount;

    MessageBox.show("Total emails for processing: " + itemsCountInInbox);

    foreach (Attachment attachmentProcess in msg.Attachments)

    {                       

         if (attachmentProcess.IsInline == true)

         {

           MessageBox.show (" Inline " + attachmentProcess.Name);

         }

         else

         {

           MessageBox.show (" Separate " + attachmentProcess.Name);

         }

    }


    • Marked as answer by S.P Singh Thursday, August 6, 2015 9:34 AM
    • Edited by S.P Singh Thursday, August 6, 2015 9:46 AM IsInline Added
    Thursday, August 6, 2015 9:32 AM

All replies

  • Please see

    https://msdn.microsoft.com/en-us/library/office/dd633665(v=exchg.80).aspx

    Thanks,
    Venkat

    Monday, August 3, 2015 3:45 PM
  • To get a file attachment 

    Bind to an existing item by using its unique identifier. The following code shows how to bind to an existing message item, requesting its Id property plus its attachments collection, and provide it with connection configuration information by using an ExchangeService object named service. The ItemId has been shortened to preserve readability.                                                                                                                                                                                                                                                    What is "Bind to an existing item by using its unique identifier"? ItemId("AAMkA") means?                                                                                                                                                                                                                                                                                                                 

    EmailMessage message = EmailMessage.Bind(service, new ItemId("AAMkA"), new PropertySet(BasePropertySet.IdOnly, ItemSchema.Attachments));


    Regards, S.P Singh

    Thursday, August 6, 2015 9:11 AM
  • var inbox = new FolderId(WellKnownFolderName.Inbox);

    var iv = new ItemView(10);

    var items = service.FindItems(inbox,iv);

    int itemsCountInInbox = items.TotalCount;

    MessageBox.show("Total emails for processing: " + itemsCountInInbox);

    foreach (Attachment attachmentProcess in msg.Attachments)

    {                       

         if (attachmentProcess.IsInline == true)

         {

           MessageBox.show (" Inline " + attachmentProcess.Name);

         }

         else

         {

           MessageBox.show (" Separate " + attachmentProcess.Name);

         }

    }


    • Marked as answer by S.P Singh Thursday, August 6, 2015 9:34 AM
    • Edited by S.P Singh Thursday, August 6, 2015 9:46 AM IsInline Added
    Thursday, August 6, 2015 9:32 AM