0

Background

Custom properties in Open XML are stored in docProps/custom.xml and look like this (for a string):

<property fmtid="{xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx}" pid="2" name="Key">
    <vt:lpwstr>Value</vt:lpwstr>
</property>

The Open XML (v1) specification doesn't give many details about fmtid and pid. It merely states in section 7.3.2.2:

[PID] Uniquely relates a custom property with an OLE property

Questions

I have a few questions about the specification's vague explanation:

  1. What are OLE properties?
  2. Is it possible add a new OpenXML property in custom.xml without storing an OLE property?
  3. Does pid need to be unique per fmtid, or unique for all fmtids in custom.xml
  4. Why don't my own properties in custom.xml appear in Word?
Natan Yellin
  • 6,063
  • 5
  • 38
  • 57
  • @otaku, that doesn't answer my questions. I need to add, not remove, properties, so a deeper understanding of custom.xml is necessary. – Natan Yellin Jul 14 '11 at 13:10
  • Otaku, please re-read my question. I'm not looking for a black-box C# function. I want to understand the connection between the Open XML properties in docProps/custom.xml and the filesystem-level NTFS properties that Office itself uses. The thread you posted doesn't *explain* how properties are implemented. Furthermore, to address your last point, adding properties to custom.xml seems to *never* make them appear in Office. Don't tell me it does until you've tried it. – Natan Yellin Jul 14 '11 at 23:03
  • If you downvote, please explain what was "unclear or not useful" about this question. – Natan Yellin Jul 17 '11 at 12:52

1 Answers1

3

I'm going to partially answer my own question based on what I discovered by experimenting.

  1. OLE properties are NTFS extended attributes that are stored in alternative file streams. They can be viewed or modified with DSOfile.dll. See this StackOverflow question.

  2. Custom properties can be added by modifying custom.xml. They will only appear in Word's properties dialog if the fmtid belongs to Word or a loaded COM add-in.

Community
  • 1
  • 1
Natan Yellin
  • 6,063
  • 5
  • 38
  • 57