none
How to set certain SpreadsheetDocument Properties? RRS feed

  • Question

  • Hi,

    I have the current Office 365 and have a question about where is and how to set certain properties:

    PackageProperties.ContentType,
    PackageProperties.Identifier,
    PackageProperties.Language,
    PackageProperties.Revision,
    PackageProperties.Version,

    because, I'm writing a WPF Desktop C# Application requires these properties to be set in order to identifytype, version and revision of the content being imported.

    In other words, the user needs to be able to set these properties in Excel before importing the content into my application.  The purpose is so they can have updated editions and/or the content has several parts to the whole content subject.

    Thanks!...


    Code is like a box of chocolates!...




    • Edited by VcDeveloper Friday, January 27, 2017 12:32 AM
    Friday, January 27, 2017 12:25 AM

All replies

  • Hi,

    These PackageProperties refer to the properties shown as picture below. You could use Office Interop or Open XML library to write.

    Please visit Workbook.BuiltinDocumentProperties Property and OpenXmlPackage.PackageProperties Property

    ContentType is based on file extension, please visit Content Types for Open XML Documents

    File Extension:

    Content Type:

    docm

    application/vnd.ms-word.document.macroEnabled.12

    docx

    application/vnd.openxmlformats-officedocument.wordprocessingml.document

    dotm

    application/vnd.ms-word.template.macroEnabled.12

    dotx

    application/vnd.openxmlformats-officedocument.wordprocessingml.template

    ppsm

    application/vnd.ms-powerpoint.slideshow.macroEnabled.12

    ppsx

    application/vnd.openxmlformats-officedocument.presentationml.slideshow

    pptm

    application/vnd.ms-powerpoint.presentation.macroEnabled.12

    pptx

    application/vnd.openxmlformats-officedocument.presentationml.presentation

    xlsb

    application/vnd.ms-excel.sheet.binary.macroEnabled.12

    xlsm

    application/vnd.ms-excel.sheet.macroEnabled.12

    xlsx

    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

    xps

    application/vnd.ms-xpsdocument

    Regards,

    Celeste


    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.

    Monday, January 30, 2017 9:29 AM
    Moderator