Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3760092
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:25:05+00:00 2026-05-19T10:25:05+00:00

I am writing a plugin for outlook 2007 and i would like to read

  • 0

I am writing a plugin for outlook 2007 and i would like to read a property of a MailItem.

In particular i’d like to know all the content-types of my attachments. Now the way i do this now is something like this:

Outlook.MailItem item = OutlookItem as Outlook.MailItem;
Outlook.Attachments itt = item.Attachments;

foreach (Outlook.Attachment t in item.Attachments)
{
textBox1.Text += t.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x370E001F");
}

But I would much rather just call something like.

t.PropertyAccessor.GetProperty(PR_ATTACH_MIME_TAG);

I can’t get that later option to work thou, however the property is mentioned that way in the msdn documentation. (http://msdn.microsoft.com/en-us/library/ms879575.aspx). Does anyone know how to nicely retrieve property’s without using the string but the constant instead?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T10:25:06+00:00Added an answer on May 19, 2026 at 10:25 am

    Recommended way of doing it is located here:

    // C#
    // Outlook 2007
    // PropertyAccessor usage sample for MailItem.Attachments[n]
    ////////////////////////////////////////////
    // For all those MAPI tags related to an Outlook Mailitem, they're all on the link:
    //ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/mapi/html/af87aa9c-02f9-4b2c-9c7b-0fa1ea27af02.htm
    // go there, then synch the index to see the full list at your disposal
    // if you have the Outlook developer's reference loaded.
    //
    // of note for attachments:
    //
    //PR_ATTACH_ADDITIONAL_INFO     0x370F0102 
    //PR_ATTACH_CONTENT_BASE        0x3711001E (0x3711001F for Unicode) 
    //PR_ATTACH_CONTENT_ID          0x3712001E (0x3712001F for Unicode) 
    //PR_ATTACH_CONTENT_LOCATION    0x3713001E (0x3713001F for Unicode) 
    //PR_ATTACH_DATA_BIN            0x37010102 The PR_ATTACH_DATA_BIN property holds the attachment when the value of the PR_ATTACH_METHOD property is ATTACH_BY_VALUE, which is the usual attachment method and the only one required to be supported.
    //PR_ATTACH_DATA_OBJ            0x3701000D The PR_ATTACH_DATA_OBJ property holds the attachment when the value of the PR_ATTACH_METHOD property is ATTACH_EMBEDDED_MSG 
    //PR_ATTACH_ENCODING            0x37020102 identifies the algorithm used to transform the data in an attachment. (see PR_ATTACH_TAG
    //PR_ATTACH_EXTENSION           0x3703001E (0x3703001F for Unicode) The receiving client should first check for PR_ATTACH_EXTENSION, and if it is not provided, should parse the filename extension from the attachment's PR_ATTACH_FILENAME or PR_ATTACH_LONG_FILENAME property.
    //PR_ATTACH_FILENAME            0x3704001E (0x3704001F for Unicode) 8.3 naming
    //PR_ATTACH_FLAGS               0x37140003 PT_LONG ATT_INVISIBLE_IN_HTML |ATT_INVISIBLE_IN_RTF 
    //PR_ATTACH_LONG_FILENAME       0x3707001E (0x3707001F for Unicode)  Platforms that support long filenames should set both the PR_ATTACH_LONG_FILENAME and PR_ATTACH_FILENAME properties when sending, and should check PR_ATTACH_LONG_FILENAME first when receiving. 
    //PR_ATTACH_LONG_PATHNAME       0x370D001E (0x370D001F for Unicode)
    //PR_ATTACH_METHOD              0x37050003 PT_LONG 
    //      NO_ATTACHMENT           - When created, all attachment objects have an initial PR_ATTACH_METHOD value of NO_ATTACHMENT
    //      ATTACH_BY_VALUE         - PR_ATTACH_DATA_BIN contains attachment data
    //      ATTACH_BY_REFERENCE     - common path accessible by sender & recipient (common file server) via PR_ATTACH_PATHNAME or PR_ATTACH_LONG_PATHNAME
    //      ATTACH_BY_REF_RESOLVE   - full path)
    //      ATTACH_BY_REF_ONLY      -  
    //      ATTACH_EMBEDDED_MSG     - PR_ATTACH_DATA_OBJ contains the object that supports IMessage interface
    //      ATTACH_OLE  
    //PR_ATTACH_MIME_SEQUENCE       0x37100003 PT_LONG
    //PR_ATTACH_MIME_TAG            0x370E001E (0x370E001F for Unicode) 
    //PR_ATTACH_NUM                 0x0E210003 PT_LONG
    //PR_ATTACH_PATHNAME            0x3708001E (0x3708001F for Unicode) 8.3 and limit of 256 characters total
    //PR_ATTACH_RENDERING           0x37090102 PT_BINARY For an attached file, PR_ATTACH_RENDERING usually portrays an icon for the file. 
    //                              - but see ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/mapi/html/be29f536-a402-4e5e-b06d-9a7af587d719.htm
    //PR_ATTACH_SIZE                0x0E200003 PT_LONG
    //PR_ATTACH_TAG                 0x370A0102 identifies the application that originally generated the attachment
    //PR_ATTACH_TRANSPORT_NAME      0x370C001E (0x370C001F for Unicode) used by TNEF and proansport provider -  It is usually not available to client applications. 
    //PR_ATTACHMENT_X400_PARAMETERS 0x37000102 UNSUPPORTED, DO NOT USE
    //
    
    
    // assume you have an Outlook.MailItem:
    // also assume that you're working on attachment # 'x' 
    // btw for newbies, attachment
    // set up the schema paths
    string SchemaPR_ATTACH_METHOD = @"http://schemas.microsoft.com/mapi/proptag/0x37050003";
    string SchemaPR_ATTACH_CONTENT_ID = @"http://schemas.microsoft.com/mapi/proptag/0x3712001E";
    
    Outlook.PropertyAccessor oPA = mailItem.Attachments[x].PropertyAccessor;
    string AttachMethod = (string)oPA.GetProperty(SchemaPR_ATTACH_METHOD);
    string AttachCID = (string)oPA.GetProperty(SchemaPR_ATTACH_CONTENT_ID);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a plugin to 3-rd party server application. I'd like to know how
I’m writing a plugin for word and would like to get the docx files
i'm writing a plugin for Eclipse and i would like to attach one of
I am writing a vim plugin in which i need to determine all those
I am writing a plugin where I need to get all the dependency artifacts
I am writing a plugin class for a framework. My interface is defined like
I'm writing a plugin for FCKeditor that's meant to insert placeholders for dynamic content
I'm writing a plugin for wordpress where certain information like a name and e-mailaddress
I'm in the middle of writing a plugin and I'd like to be able
I'm writing some plugin code in a dll that is called by a host

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.