File: UsingCommonProperties_HV01147181.htm

package info (click to toggle)
office2003-schemas 1.0%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, forky, sid, trixie
  • size: 42,304 kB
  • sloc: javascript: 2,429; makefile: 29
file content (83 lines) | stat: -rw-r--r-- 16,769 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01147181"><META NAME="lcid" CONTENT="1033"><title>Using the Document Properties and SmartTags Elements in Office Documents</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><h1>Using the Document Properties and SmartTags Elements in Office Documents</h1><p>A number of elements in the "urn:schemas-microsoft-com:office:office" namespace (referred to in this document as the Common Properties namespace) are used in several applications in the Microsoft Office 2003 Editions. This document reviews the following elements:</p><ul><li>The three sets of elements that contain information displayed on the Properties dialog box (available on the File menu in an Office document)
</li><li>The elements used to contain information related to smart tags</li></ul><p>There is no root element to contain the elements in the Common Properties namespace. Instead, the elements in the Common Properties namespace are used by other XML dialects within the root element defined for that document type. For example, in a WordprocessingML document, the DocumentProperties element of the Common Properties namespace appears as the first child element within the WordprocessingML wordDocument root element:</p><p><code>&lt;w:wordDocument 
   xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
   xmlns:o=</code></p><p><code>"urn:schemas-microsoft-com:office:office" xml:space="preserve"&gt;</code></p><p><code>
&lt;o:DocumentProperties&gt;
   &lt;o:Title&gt;A Document&lt;/o:Title&gt;</code></p><p><code> 
   &lt;o:Revision&gt;22&lt;/o:Revision&gt; 
&lt;/o:DocumentProperties&gt;
	</code></p><p><code>&lt;w:fonts&gt;
...remainder of WordProccessingML document...

</code></p><h2>Document Properties and Custom Properties</h2><p>The information contained in these properties elements is displayed on the <b class="ui">Document Properties</b> dialog box associated with a document, on the <b class="ui">Summary</b>, <b class="ui">Statistics</b>, and <b class="ui">Custom</b> tabs.
</p><p>The information on the <b class="ui">Summary</b> and <b class="ui">Statistics</b> tabs is contained in the <b class="bterm">DocumentProperties</b> element. Custom properties are contained in the <b class="bterm">CustomDocumentProperties</b> element.
</p><h3>The DocumentProperties Element</h3><p>For many of the child elements of the <b class="bterm">DocumentProperties</b> element, an application may both generate information for document properties as part of creating an Office document and read those elements to obtain information about document properties. For a number of these elements, however, it's unlikely that an application generates the information explicitly (for example, statistics related to the document such as the number of characters or number of pages). Should an application write this information to an Office document, the Office application may ignore the information. For example, Microsoft Office Word 2003 uses the values it finds in the <b class="bterm">Words</b> and <b class="bterm">Pages</b> elements only for the length of time that it takes to generate actual counts<nbsp />— typically the time that it takes to load the document. The primary purpose for these elements is to provide other applications with information about a document after it is processed in Word.
The elements within the <b class="bterm">DocumentProperties</b> element are not required to appear in any particular order. Not all Office applications write out all of these elements to the XML document. For example, for the automatically generated statistics, Microsoft Office Excel 2003 saves only the Created and Version elements.
</p><h3>Table 1. Elements of the DocumentProperties element</h3><table><tr><td><b class="bterm">Element</b></td><td><b class="bterm">Data Type</b></td><td><b class="bterm">Description</b></td></tr><tr><td>Title</td><td>string</td><td>The title of a document. The title can be different from the file name and is used when searching for the file and when creating Web pages from the file. </td></tr><tr><td>Subject</td><td>string</td><td>The subject of the document. This property can be used to group similar files, so you can search for all files that have the same subject.</td></tr><tr><td>Keywords</td><td>string</td><td>Keywords to be used when searching for the document.</td></tr><tr><td>Description</td><td>string</td><td>Comments to be used when searching for the document.</td></tr><tr><td>Category</td><td>string</td><td>The category of the file. This property can be used to group similar files, so you can search for all the files that have the same category.</td></tr><tr><td>Author</td><td>string</td><td>The name of the person who first created the document. The name of the person who last saved the document is contained in the LastAuthor element.</td></tr><tr><td>LastAuthor</td><td>string</td><td>The name of the person who last saved the document. The original author is contained in the Author element.</td></tr><tr><td>Manager</td><td>string</td><td>The name of the author's manager. This property can be used in searches to group all the documents of authors having the same manager.</td></tr><tr><td>Company</td><td>string</td><td>The author's employer. This property can be used in searches to group all of the documents from the same company.</td></tr><tr><td>HyperlinkBase</td><td>string</td><td>The path or URL that is used for all hyperlinks with the same base address in a document. This property can be an Internet address (for example, http://www.microsoft.com), a path to a folder on your hard disk (for example, c:\personal\documents), or a path to a folder on a network (for example, \\exampleserver\public\documents).</td></tr><tr><td>Revision</td><td>integer</td><td>The number of times the document was saved. If no change was made since the document was last saved, this number is not updated in Word.</td></tr><tr><td>PresentationFormat</td><td>string</td><td>The viewing format of a document.</td></tr><tr><td>Guid</td><td>string</td><td>A unique identification number for the document.</td></tr><tr><td>AppName</td><td>string</td><td>The name of the application that last updated the document. Word and Excel do not update this element.</td></tr><tr><td>Version</td><td>version*</td><td>The version of the application used to create the document. Word and Excel update this element.</td></tr><tr><td>TotalTime</td><td>integer</td><td>The number of minutes since it was created that the document was open for making changes (even if no changes are made).</td></tr><tr><td>LastPrinted</td><td>date/time**</td><td>The date and time that the document was last printed. Word omits this element if the document has not been printed. </td></tr><tr><td>Created</td><td>date/time**</td><td>The date and time that the document was created.</td></tr><tr><td>LastSaved</td><td>date/time**</td><td>The date and time that the document was last saved.</td></tr><tr><td>Pages</td><td>integer</td><td>An estimate of the number of pages in the document.</td></tr><tr><td>Words</td><td>integer</td><td>An estimate of the number of words in the document.</td></tr><tr><td>Characters</td><td>integer</td><td>An estimate of the number of characters in the document, not counting spaces.</td></tr><tr><td>CarachersWithSpaces</td><td>integer</td><td>An estimate of the number of characters in the document, counting spaces.</td></tr><tr><td>Bytes</td><td>integer</td><td>An estimate of the number of bytes in the document.</td></tr><tr><td>Lines</td><td>integer</td><td>An estimate of the number of lines in the document.</td></tr><tr><td>Paragraphs</td><td>integer</td><td>An estimate of the number of paragraphs in the document.</td></tr></table><dl><dd>* The format for the Version value is n.nn.</dd><dd>** The format for date/time fields is yyyy-mm-ddThh:mm:ssZ. (This format can be described as follows: a four-digit year, hyphen, two-digit month, hyphen, two-digit day, uppercase letter T, two-digit hour, colon, two-digit minute value, colon, two-digit seconds value, uppercase letter Z. Only seconds may be fractional).</dd></dl><p>The following is an example of a DocumentProperties section in an XML document:</p><p><code>&lt;o:DocumentProperties&gt;
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Title&gt;Office XML Primer&lt;/o:Title&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Subject&gt;Selected tags from the Common Properties namespace&lt;/o:Subject&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Author&gt;Holly Dickson&lt;/o:Author&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Keywords&gt;Microsoft Office office namespace xml&lt;/o:Keywords&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Description&gt;This document includes information about the 
   DocumentProperties, SmartTags, </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;and CustomProperties elements and their
   children.&lt;/o:Description&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:LastAuthor&gt;Holly Dickson&lt;/o:LastAuthor&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Revision&gt;9&lt;/o:Revision&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:TotalTime&gt;9&lt;/o:TotalTime&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Created&gt;2003-10-21T16:23:00Z&lt;/o:Created&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:LastSaved&gt;2003-10-21T16:33:00Z&lt;/o:LastSaved&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Pages&gt;2&lt;/o:Pages&gt;</code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp; 
   &lt;o:Words&gt;1016&lt;/o:Words&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Characters&gt;5125&lt;/o:Characters&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Category&gt;Office XML&lt;/o:Category&gt;</code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp; 
   &lt;o:Manager&gt;Toby Nixon&lt;/o:Manager&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Company&gt;Northwind Traders&lt;/o:Company&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:HyperlinkBase&gt; http://www.northwindtraders.com/
   &lt;/o:HyperlinkBase&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Lines&gt;160&lt;/o:Lines&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Paragraphs&gt;6&lt;/o:Paragraphs&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:CharactersWithSpaces&gt;7125&lt;/o:CharactersWithSpaces&gt;</code></p><p><code> 
   &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Version&gt;11.5329&lt;/o:Version&gt; 
</code></p><p><code>&lt;/o:DocumentProperties&gt;
</code></p><h2>The CustomDocumentProperties Element
</h2><p>In addition to the predefined document property elements, you can save information in an XML document in Office by using custom properties. Custom properties allow the application to define new name/value pairs and save them in the document. Custom properties are held in the <b class="bterm">CustomDocumentProperties</b> element.
Within the CustomDocumentProperties element, the name of the custom property is the name of the element that holds the value for the custom property. This new element is associated with the Common Properties namespace. The new element has an attribute called dt that specifies the value's data type. (The dt attribute is associated with the "uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" namespace.) The dt attribute can have one of four values: 
</p><ul><li>string: String data</li><li>	float: All numeric data</li><li>date: Any date/time data. The format for the value is the same as that used in the date elements in the DocumentProperties element.
</li><li>Boolean: Either 1 (for true/yes) or 0 (for false/no).</li>
</ul><p>In the following example, the following data is saved:</p><ul><li>The name of the document's editor ("Frank Miller")
</li><li>The date of the last review of the document (February 28, 1997 with no time component)
</li><li>The number of editorial passes (3)
</li><li>Whether or not the document complies with the company style guide (true)</li></ul><p><code>&lt;o:CustomDocumentProperties
   xmlns:o="urn:schemas-microsoft-com:office:office" 
   xmlns:dt=</code></p><p><code>"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" &gt;
   </code></p><p>  <code>  &nbsp;&nbsp;&nbsp;&nbsp;&lt;o:Editor dt:dt="string"&gt;Frank Miller&lt;/o:Editor&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:LastReview dt:dt="dateTime.tz"&gt;1997-02-28T23:00:00Z&lt;/o:LastReview&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:EditPasses dt:dt="float"&gt;3&lt;/o:EditPasses&gt; 
   </code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;o:StyleGuideCompliant dt:dt="boolean"&gt;1&lt;/o:StyleGuideCompliant&gt;</code></p><p><code> 
&lt;/o:CustomDocumentProperties&gt;
</code></p><h2>

Smart Tags
</h2><p>Two elements contain information related to smart tags: <b class="bterm">SmartTagType</b> and <b class="bterm">SmartTags</b>.
</p><p>The <b class="bterm">SmartTagType</b> element declares what smart tags appear in the document. In a document that contains different types of smart tags, there are multiple <b class="bterm">SmartTagType</b> elements. However, in a document where the same type of smart tag appears multiple times, only a single <b class="bterm">SmartTagType</b> element is required. The <b class="bterm">SmartTagType</b> element appears in different places in different documents. In Excel, for example, it is the first child of the root element (the <b class="bterm">Workbook</b> element). 
</p><p>A <b class="bterm">SmartTagType</b> includes two pieces of information: the namespace for the <b class="bterm">SmartTags</b> element and the name of the root element of the smart tag. The namespace appears in the <b class="bterm">namespaceuri</b> attribute of the <b class="bterm">SmartTagType</b> element and the root element name appears in the name attribute of the <b class="bterm">SmartTagType</b> element. In addition, the <b class="bterm">SmartTagType</b> element can have a url attribute, which points to a URL required by the smart tag. 
</p><p>In the following example, the MapPoint geoheading smart tag is declared for use in the document:
</p><p><code>&lt;SmartTagType  
   namespaceuri="urn:schemas-microsoft-com:mappoint:smarttags"
   name=</code></p><p><code>"geoheading" xmlns="urn:schemas-microsoft-com:office:office"/&gt;
</code></p><p>Within the document, the <b class="bterm">SmartTags</b> element marks where smart tags appear in the document. In different document types, the SmartTags element appears in different places. When used in Excel, for example, the <b class="bterm">SmartTags</b> element appears as the first child of the <b class="bterm">Cell</b> element. 
</p><p>The <b class="bterm">SmartTags</b> element doesn't define any particular smart tag. The <b class="bterm">SmartTags</b> element is rather a container for the elements that specify the smart tag used in a document. The <b class="bterm">SmartTags</b> element has no attributes and can contain any well-formed XML content. 
</p><p>In the following example, the <b class="bterm">SmartTags</b> element contains the geoheading smart tag declared in the previous example:
</p><p><code>&lt;SmartTags xmlns="urn:schemas-microsoft-com:office:office"
xmlns:st1="urn:schemas-microsoft-com:mappoint:smarttags"&gt;
</code></p><p><code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;st1:geoheading GeoFieldType="3:NA,3:EUR" GeoCountry="0:NA,0:EUR"/&gt;
</code></p><p><code>&lt;/SmartTags&gt;
</code></p><p>The elements corresponding to smart tags that appear inside the <b class="bterm">SmartTags</b> element belong to the namespace from the namespaceuri attribute of the <b class="bterm">SmartTagType</b> element in which the smart tag was declared. That namespace must be defined somewhere in the document, and it must be associated with the elements that define the smart tag. In the previous example, the prefix "st1" was defined and associated with the namespace as part of the <b class="bterm">SmartTags</b> element.</p><center><a href="XMLSchemaCopyright_HV01147162.htm">&copy;2003-2004 Microsoft Corporation. All rights reserved.</a>  

Permission to copy, display and distribute this document is available at: <a 

href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&amp;CTT=11&amp;Origin=HV011232471033" 

target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>