DataSourceObject Class

Office Data Source Object Settings.When the object is serialized out as xml, its qualified name is w:odso.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Wordprocessing.DataSourceObject

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

声明
<ChildElementInfoAttribute(GetType(MailMergeSource))> _
<ChildElementInfoAttribute(GetType(ColumnDelimiter))> _
<ChildElementInfoAttribute(GetType(SourceReference))> _
<ChildElementInfoAttribute(GetType(RecipientDataReference))> _
<ChildElementInfoAttribute(GetType(UdlConnectionString))> _
<ChildElementInfoAttribute(GetType(DataSourceTableName))> _
<ChildElementInfoAttribute(GetType(FirstRowHeader))> _
<ChildElementInfoAttribute(GetType(FieldMapData))> _
Public Class DataSourceObject _
    Inherits OpenXmlCompositeElement
用法
Dim instance As DataSourceObject
[ChildElementInfoAttribute(typeof(MailMergeSource))]
[ChildElementInfoAttribute(typeof(ColumnDelimiter))]
[ChildElementInfoAttribute(typeof(SourceReference))]
[ChildElementInfoAttribute(typeof(RecipientDataReference))]
[ChildElementInfoAttribute(typeof(UdlConnectionString))]
[ChildElementInfoAttribute(typeof(DataSourceTableName))]
[ChildElementInfoAttribute(typeof(FirstRowHeader))]
[ChildElementInfoAttribute(typeof(FieldMapData))]
public class DataSourceObject : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • UdlConnectionString <w:udl>

  • DataSourceTableName <w:table>

  • SourceReference <w:src>

  • ColumnDelimiter <w:colDelim>

  • MailMergeSource <w:type>

  • FirstRowHeader <w:fHdr>

  • FieldMapData <w:fieldMapData>

  • RecipientDataReference <w:recipientData>

[ISO/IEC 29500-1 第 1 个版本]

17.14.25 odso (Office Data Source Object Settings)

This element specifies a group of additional settings for the mail merge information which comprise an extension to the standard settings stored with a mail merge which performs two functions:

  • First, it provides additional information about the mail merge data source, specifically: information about how to map the columns in the data source to MERGEFIELD fields and information about records which shall be included and excluded when creating merged documents, and column delimiters used in text data sources. This information can be used regardless of the value of the dataType element (§17.14.10) when it is present.

  • Second, it provides an alternate set of connection information which should be used when the dataType element (§17.14.10) specifies a value of native. This alternate connection string provides additional connection information for applications which choose to support the ODSO connection string syntax. If the dataType element (§17.14.10) specifies that the data type of the current mail merge is not native, then the second group of settings specified within this element shall be ignored in favor of their non-ODSO equivalents.

[Example: Consider the WordprocessingML for a source document whose mail merge includes mail merge information including ODSO settings as follows:

<w:odso>
<w:udl w:val="…" />
<w:table w:val="Sheet1$" />
<w:src r:id="rId1" />
<w:colDelim w:val="9" />
<w:fHdr w:val="1" />
<w:fieldMapData>
<w:type w:val="dbColumn" />
<w:name w:val="Title" />
<w:mappedName w:val="Courtesy Title" />
<w:lid w:val="en-US" />
</w:fieldMapData>
<w:recipientData r:id="rId2" />
…
</w:odso>

The odso element and its child elements provide all of the information specified above that is needed to carry out a mail merge with the current document. This includes alternate connection information using the udl, table, and src elements, and additional mail merge information in the other child elements. end example]

Parent Elements

mailMerge (§17.14.20)

Child Elements

Subclause

colDelim (Column Delimiter for Data Source)

§17.14.5

fHdr (First Row of Data Source Contains Column Names)

§17.14.14

fieldMapData (External Data Source to Merge Field Mapping)

§17.14.15

recipientData (Reference to Inclusion/Exclusion Data for Data Source)

§17.14.28

src (ODSO Data Source File Path)

§17.14.30

table (Data Source Table Name)

§17.14.31

type (ODSO Data Source Type)

§17.14.32

udl (UDL Connection String)

§17.14.34

[Note: The W3C XML Schema definition of this element's content model (CT_Odso) is located in §A.1. end note]

© ISO/IEC29500: 2008. 以上摘要已经由 Microsoft(和/或其代理公司)从英语翻译为简体中文,ISO 对此翻译不承担任何责任。

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

DataSourceObject Members

DocumentFormat.OpenXml.Wordprocessing Namespace