Run クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ふりがなテキストの実行します。 オブジェクトを xml としてシリアル化されるときに、修飾名は、w:r です。
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.RunProperties))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.Break))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.Text))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.DeletedText))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.FieldCode))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.DeletedFieldCode))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.NoBreakHyphen))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.SoftHyphen))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.DayShort))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.MonthShort))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.YearShort))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.DayLong))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.MonthLong))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.YearLong))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.AnnotationReferenceMark))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.FootnoteReferenceMark))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.EndnoteReferenceMark))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.SeparatorMark))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.ContinuationSeparatorMark))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.SymbolChar))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.PageNumber))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.CarriageReturn))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.TabChar))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.EmbeddedObject))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.Picture))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.FieldChar))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.Ruby))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.FootnoteReference))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.EndnoteReference))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.CommentReference))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.Drawing))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.PositionalTab))]
[DocumentFormat.OpenXml.ChildElementInfo(typeof(DocumentFormat.OpenXml.Wordprocessing.LastRenderedPageBreak))]
public class Run : DocumentFormat.OpenXml.OpenXmlCompositeElement
type Run = class
inherit OpenXmlCompositeElement
Public Class Run
Inherits OpenXmlCompositeElement
- 継承
- 属性
例
次の使用例は、ワープロ文書を作成し、テキストを書き込み、「こんにちは, World!」 します。
using System;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
namespace RunEx
{
class Program
{
static void Main(string[] args)
{
// Create a document by path, and write some text in it.
string fileName = @"C:\Users\Public\Documents\RunEx.docx";
string txt = "Hello, world!";
// Create the Word document.
WordprocessingDocument wordprocessingDocument =
WordprocessingDocument.Create(fileName,
WordprocessingDocumentType.Document);
// Create a MainDocumentPart instance.
MainDocumentPart mainDocumentPart =
wordprocessingDocument.AddMainDocumentPart();
mainDocumentPart.Document = new Document();
// Create a Document instance.
Document document = mainDocumentPart.Document;
// Create a Body instance.
Body body = document.AppendChild(new Body());
// Create a Paragraph instance.
Paragraph para = body.AppendChild(new Paragraph());
// Create a Run instance.
Run run = para.AppendChild(new Run());
// Add Text to the Run element.
run.AppendChild(new Text(txt));
// Close the document handle
wordprocessingDocument.Close();
Console.WriteLine("The document has been created. Press any key.");
Console.ReadKey();
}
}
}
Imports DocumentFormat.OpenXml
Imports DocumentFormat.OpenXml.Packaging
Imports DocumentFormat.OpenXml.Wordprocessing
Module Module1
Sub Main(ByVal args As String())
' Create a document by path, and write some text in it.
Dim fileName As String = "C:\Users\Public\Documents\RunEx.docx"
Dim txt As String = "Hello, world!"
' Create the Word document.
Dim wordprocessingDocument As WordprocessingDocument = _
wordprocessingDocument.Create(fileName, WordprocessingDocumentType.Document)
' Create a MainDocumentPart instance.
Dim mainDocumentPart As MainDocumentPart = _
wordprocessingDocument.AddMainDocumentPart()
mainDocumentPart.Document = New Document()
' Create a Document instance.
Dim document As Document = mainDocumentPart.Document
' Create a Body instance.
Dim body As Body = document.AppendChild(New Body())
' Create a Paragraph instance.
Dim para As Paragraph = body.AppendChild(New Paragraph())
' Create a Run instance.
Dim run As Run = para.AppendChild(New Run())
' Add Text to the Run element.
run.AppendChild(New Text(txt))
' Close the document handle
wordprocessingDocument.Close()
Console.WriteLine("The document has been created. Press any key.")
Console.ReadKey()
End Sub
End Module
注釈
[ISO/IEC 29500-1 1st Edition]
r の (テキストの実行)
この要素は、親フィールド、ハイパーリンク、カスタムの XML 要素、構造化ドキュメント タグ、スマート タグは、段落のコンテンツの実行を指定します。
WordprocessingML ドキュメント内の実行の内容は、コンテンツの実行の任意の組み合わせで構成されます。
[例: 基本的な WordprocessingML 段落を 2 つの実行を検討してください。 この実行は次のように表されます。
<w:document>
<w:body>
<w:p>
<w:r>
<w:t>Text</w:t>
</w:r>
<w:fldSimple w:instr="AUTHOR">
<w:r>
<w:t>Author Name</w:t>
</w:r>
</w:fldSimple>
</w:p>
</w:body>
</w:document>
R 要素は、この例では段落の実行と単純なフィールド内の実行の両方が含まれている実行時にコンテンツのすべてのコンテナーです。 例終わり]
| 親要素 |
|---|
| bdo (§17.3.2.3)。customXml (§17.5.1.3)。del (§17.13.5.14)。dir (§17.3.2.8)。fldSimple (§17.16.19)。ハイパーリンク (§17.16.22)。ins (§17.13.5.18)。moveFrom (§17.13.5.22)。[moveto] (§17.13.5.25)。p (§17.3.1.22)。rt (§17.3.3.24)。rubyBase (§17.3.3.27)。sdtContent (§17.5.2.36)。smartTag (§17.5.1.9) |
| 子要素 | 句 |
|---|---|
| annotationRef (コメントの情報ブロック) | §17.13.4.1 |
| br (区切り) | §17.3.3.1 |
| commentReference (コメント コンテンツ記号) | §17.13.4.5 |
| contentPart (コンテンツの一部) | §17.3.3.2 |
| continuationSeparator (後続の区切り記号) | §17.11.1 |
| (キャリッジ リターン) cr | §17.3.3.4 |
| dayLong (日付ブロックの長い日付形式) | §17.3.3.5 |
| dayShort (ブロックの日付 - 日付の短い形式) | §17.3.3.6 |
| delInstrText (フィールド コードを削除する) | §17.16.13 |
| delText (削除された箇所) | §17.3.3.7 |
| 図面 (DrawingML オブジェクト) | §17.3.3.9 |
| endnoteRef (文末脚注記号) | §17.11.6 |
| endnoteReference (文末脚注参照) | §17.11.7 |
| fldChar (複雑なフィールドの文字) | §17.16.18 |
| footnoteRef (脚注記号) | §17.11.13 |
| 脚注 (脚注参照) | §17.11.14 |
| instrText (フィールド コード) | §17.16.23 |
| (位置の最後の計算で改ページ) lastRenderedPageBreak | §17.3.3.13 |
| 長期 (月の長い形式の日付ブロック) | §17.3.3.15 |
| monthShort (ブロックの日付の月の短い形式) | §17.3.3.16 |
| noBreakHyphen (非中断ハイフン) | §17.3.3.18 |
| オブジェクト (埋め込まれたオブジェクト) | §17.3.3.19 |
| pgNum (ページ番号のブロック) | §17.3.3.22 |
| ptab (絶対位置タブ文字) | §17.3.3.23 |
| rPr (実行のプロパティ) | §17.3.2.28 |
| ルビ (ふりがな) | §17.3.3.25 |
| 区切り記号 (脚注/文末脚注の区切り記号) | §17.11.23 |
| softHyphen (省略可能なハイフン文字) | §17.3.3.29 |
| sym (記号) | §17.3.3.30 |
| t (テキスト) | §17.3.3.31 |
| タブ (タブ文字) | §17.3.3.32 |
| yearLong (日付ブロック - 長い形式) | §17.3.3.33 |
| yearShort (ブロックの日付の年の短い形式) | §17.3.3.34 |
| 属性 | 説明 |
|---|---|
| rsidDel (削除の実行のリビジョン Id) | 実行をメイン文書から削除されたとき、編集のセッションを追跡するために使用される一意の識別子を指定します。 Rsid * 属性をすべて同じ値では、このドキュメント全体にわたって存在する場合、本を示す (それ以降の保存操作の間に) 同じ編集セッション中にそれらの領域が変更されたことです。 プロデューサーは、リビジョンをこのドキュメント内の他の変更に対する変更の順序を示すためにそれ以降の編集セッションを示すために ID の値を保存を選択できます。 この属性の値は、 ST_LongHexNumberの単純型 (§17.18.50) によって定義されます。 |
| rsidR (実行のリビジョン Id) | 実行のメイン文書に追加された編集のセッションを追跡するために使用される一意の識別子を指定します。 Rsid * 属性をすべて同じ値では、このドキュメント全体にわたって存在する場合、本を示す (それ以降の保存操作の間に) 同じ編集セッション中にそれらの領域が変更されたことです。 プロデューサーは、リビジョンをこのドキュメント内の他の変更に対する変更の順序を示すためにそれ以降の編集セッションを示すために ID の値を保存を選択できます。 この属性の値は、 ST_LongHexNumberの単純型 (§17.18.50) によって定義されます。 |
| rsidRPr (実行のプロパティのリビジョン Id) | メイン文書で実行のプロパティの最終変更時の編集セッションを追跡するために使用される一意の識別子を指定します。 Rsid * 属性をすべて同じ値では、このドキュメント全体にわたって存在する場合、本を示す (それ以降の保存操作の間に) 同じ編集セッション中にそれらの領域が変更されたことです。 プロデューサーは、リビジョンをこのドキュメント内の他の変更に対する変更の順序を示すためにそれ以降の編集セッションを示すために ID の値を保存を選択できます。 この属性の値は、 ST_LongHexNumberの単純型 (§17.18.50) によって定義されます。 |
[注: この要素のコンテンツ モデル (CT_R) の W3C XML スキーマ定義は §A.1 であります。 メモの終了)
ISO/IEC29500: 2008。
コンストラクター
| Run() |
実行クラスの新しいインスタンスを初期化します。 |
| Run(IEnumerable<OpenXmlElement>) |
指定した子要素を使用して実行クラスの新しいインスタンスを初期化します。 |
| Run(OpenXmlElement[]) |
指定した子要素を使用して実行クラスの新しいインスタンスを初期化します。 |
| Run(String) |
外側の XML から実行クラスの新しいインスタンスを初期化します。 |
プロパティ
| ChildElements |
現在の要素のすべての子ノードを取得します。 (継承元 OpenXmlElement) |
| ExtendedAttributes |
現在の要素のすべての拡張属性 (スキーマで定義されていない属性) を取得します。 (継承元 OpenXmlElement) |
| FirstChild |
現在の OpenXmlElement 要素の最初の子を取得します。 (継承元 OpenXmlCompositeElement) |
| HasAttributes |
現在の要素に属性が含されているかどうかを示すブール値を取得します。 (継承元 OpenXmlElement) |
| HasChildren |
現在の要素に子要素が含されているかどうかを示す値を取得します。 (継承元 OpenXmlCompositeElement) |
| InnerText |
現在のノードとそのすべての子の連結値を取得または設定します。 (継承元 OpenXmlCompositeElement) |
| InnerXml |
現在のノードの子ノードのみを表すマークアップを取得または設定します。 (継承元 OpenXmlCompositeElement) |
| LastChild |
現在の OpenXmlElement 要素の最後の子を取得します。 このような OpenXmlElement 要素がないVisual Basic null (Nothing in Visual Basic) を返します。 (継承元 OpenXmlCompositeElement) |
| LocalName |
要素のローカル名を取得します。 |
| MCAttributes |
マークアップの互換性属性を設定します。 現在の要素に対してマークアップ互換性属性が定義されていない場合は null を返します。 (継承元 OpenXmlElement) |
| NamespaceDeclarations |
現在の要素で定義されている名前空間宣言を取得します。 名前空間宣言がない場合は、空の列挙子を返します。 (継承元 OpenXmlElement) |
| NamespaceUri |
現在の要素の名前空間 URI を取得します。 (継承元 OpenXmlElement) |
| OpenXmlElementContext |
現在の要素の OpenXmlEementContext を取得します。 (継承元 OpenXmlElement) |
| OuterXml |
現在の要素とそのすべての子要素を表すマークアップを取得します。 (継承元 OpenXmlElement) |
| Parent |
現在の要素の親要素を取得します。 (継承元 OpenXmlElement) |
| Prefix |
現在の要素の名前空間プレフィックスを取得します。 (継承元 OpenXmlElement) |
| RsidRunAddition |
Run.Represents のスキーマの属性の次のリビジョン Id: w:rsidR |
| RsidRunDeletion |
実行の Deletion.Represents のスキーマの属性の次のリビジョン Id: w:rsidDel |
| RsidRunProperties |
実行の Properties.Represents のスキーマの属性の次のリビジョン Id: w:rsidRPr |
| RunProperties |
プロパティを実行します。 スキーマでは、次の要素タグを表します w:rPr。 |
| XmlQualifiedName |
現在の要素の修飾名を取得します。 (継承元 OpenXmlElement) |
| XName |
現在の要素の修飾名を取得します。 (継承元 OpenXmlElement) |
メソッド
| AddAnnotation(Object) |
現在の OpenXmlElement 要素の注釈の一覧にオブジェクトを追加します。 (継承元 OpenXmlElement) |
| AddNamespaceDeclaration(String, String) |
現在のノードに namepace 宣言を追加します。 (継承元 OpenXmlElement) |
| Ancestors() |
現在の要素のすべての先祖を列挙します。 (継承元 OpenXmlElement) |
| Ancestors<T>() |
指定した型を持つ現在の要素の先祖のみを列挙します。 (継承元 OpenXmlElement) |
| Annotation(Type) |
現在の OpenXmlElement 要素から、指定した型の最初の注釈オブジェクトを取得します。 (継承元 OpenXmlElement) |
| Annotation<T>() |
現在の OpenXmlElement 要素から、指定した型の最初の注釈オブジェクトを取得します。 (継承元 OpenXmlElement) |
| Annotations(Type) |
現在の OpenXmlElement 要素の指定した型を持つ注釈のコレクションを取得します。 (継承元 OpenXmlElement) |
| Annotations<T>() |
現在の OpenXmlElement 要素の指定した型を持つ注釈のコレクションを取得します。 (継承元 OpenXmlElement) |
| Append(IEnumerable<OpenXmlElement>) |
要素のリストから、現在の要素の子要素のリストの末尾に各要素を追加します。 (継承元 OpenXmlElement) |
| Append(OpenXmlElement[]) |
要素の配列から、現在の要素の子要素のリストの末尾に各要素を追加します。 (継承元 OpenXmlElement) |
| AppendChild<T>(T) |
指定した要素を、現在の要素の子ノードのリストの末尾に追加します。 (継承元 OpenXmlCompositeElement) |
| ClearAllAttributes() |
既知の属性と拡張属性の両方を含む、すべての属性をクリアします。 (継承元 OpenXmlElement) |
| Clone() |
現在のノードの複製を作成します。 (継承元 OpenXmlElement) |
| CloneNode(Boolean) |
このノードの複製を作成します。 |
| Descendants() |
現在の要素のすべての子孫を列挙します。 (継承元 OpenXmlElement) |
| Descendants<T>() |
現在の要素の T 型のすべての子孫を列挙します。 (継承元 OpenXmlElement) |
| Elements() |
現在の要素のすべての子を列挙します。 (継承元 OpenXmlElement) |
| Elements<T>() |
指定した型を持つ現在の要素の子のみを列挙します。 (継承元 OpenXmlElement) |
| ElementsAfter() |
現在の要素に従い、現在の要素と同じ親を持つすべての兄弟要素を列挙します。 (継承元 OpenXmlElement) |
| ElementsBefore() |
現在の要素の前に、現在の要素と同じ親を持つすべての兄弟要素を列挙します。 (継承元 OpenXmlElement) |
| GetAttribute(String, String) |
指定したタグ名と名前空間 URI を持つ Open XML 属性を取得します。 (継承元 OpenXmlElement) |
| GetAttributes() |
すべての属性のコピーを含むリストを取得します。 (継承元 OpenXmlElement) |
| GetEnumerator() |
子コレクションを反復処理する列挙子を返します。 (継承元 OpenXmlElement) |
| GetFirstChild<T>() |
型 T の最初の子要素を検索します。 (継承元 OpenXmlElement) |
| InsertAfter<T>(T, OpenXmlElement) |
指定した参照要素の直後に、指定した要素を挿入します。 (継承元 OpenXmlCompositeElement) |
| InsertAfterSelf<T>(T) |
現在の要素の直後に指定した要素を挿入します。 (継承元 OpenXmlElement) |
| InsertAt<T>(T, Int32) |
現在の要素の子の指定したインデックスに、指定した要素を挿入します。 (継承元 OpenXmlCompositeElement) |
| InsertBefore<T>(T, OpenXmlElement) |
指定した参照要素の直前に、指定した要素を挿入します。 (継承元 OpenXmlCompositeElement) |
| InsertBeforeSelf<T>(T) |
現在の要素の直前に指定した要素を挿入します。 (継承元 OpenXmlElement) |
| IsAfter(OpenXmlElement) |
ドキュメントの順序で指定した要素の後に現在の要素が表示されるかどうかを指定します。 (継承元 OpenXmlElement) |
| IsBefore(OpenXmlElement) |
現在の要素が文書の順序で指定された要素の前に表示されるかどうかを指定します。 (継承元 OpenXmlElement) |
| LookupNamespace(String) |
現在のノードのコンテキストで名前空間プレフィックスを解決します。 (継承元 OpenXmlElement) |
| LookupPrefix(String) |
現在の要素スコープ内の名前空間 uri の対応するプレフィックスを検索します。 (継承元 OpenXmlElement) |
| NextSibling() |
現在の OpenXmlElement 要素の直後にある OpenXmlElement 要素を取得します。 次の OpenXmlElement 要素がないVisual Basic null (Nothing in Visual Basic) を返します。 (継承元 OpenXmlElement) |
| NextSibling<T>() |
現在の OpenXmlElement 要素に続く、指定した型を持つ OpenXmlElement 要素を取得します。 次の OpenXmlElement がないVisual Basic null (Nothing in Visual Basic) を返します。 (継承元 OpenXmlElement) |
| PrependChild<T>(T) |
現在の要素の子ノードのリストの先頭に指定した要素を挿入します。 (継承元 OpenXmlCompositeElement) |
| PreviousSibling() |
現在の OpenXmlElement 要素の直前にある OpenXmlElement 要素を取得します。 前の OpenXmlElement 要素がないVisual Basic null ( Nothing in Visual Basic ) を返します。 (継承元 OpenXmlElement) |
| PreviousSibling<T>() |
現在の OpenXmlElement の前に指定された型を持つ OpenXmlElement 要素を取得します。 前の OpenXmlElement 要素がない場合は、null (Visual Basic 内の Nothing) を返します。 (継承元 OpenXmlElement) |
| Remove() |
現在の要素を親から削除します。 (継承元 OpenXmlElement) |
| RemoveAllChildren() |
現在の要素のすべての子要素を削除します。 (継承元 OpenXmlCompositeElement) |
| RemoveAllChildren<T>() |
T 型の現在の要素のすべての子要素を削除します。 (継承元 OpenXmlElement) |
| RemoveAnnotations(Type) |
現在の OpenXmlElement 要素から、指定した型の注釈を削除します。 (継承元 OpenXmlElement) |
| RemoveAnnotations<T>() |
現在の OpenXmlElement 要素から、指定した型の注釈を削除します。 (継承元 OpenXmlElement) |
| RemoveAttribute(String, String) |
現在の要素から属性を削除します。 (継承元 OpenXmlElement) |
| RemoveChild<T>(T) |
指定した子要素を削除します。 (継承元 OpenXmlCompositeElement) |
| RemoveNamespaceDeclaration(String) |
指定したプレフィックスの名前空間宣言を削除します。 プレフィックスがない場合は何も削除しません。 (継承元 OpenXmlElement) |
| ReplaceChild<T>(OpenXmlElement, T) |
現在の要素の子要素の 1 つを別の OpenXmlElement 要素に置き換える。 (継承元 OpenXmlCompositeElement) |
| SetAttribute(OpenXmlAttribute) |
属性を指定した要素に設定します。 属性が既知の属性の場合、属性の値が設定されます。 属性が拡張属性の場合、'openxmlAttribute' が拡張属性リストに追加されます。 (継承元 OpenXmlElement) |
| SetAttributes(IEnumerable<OpenXmlAttribute>) |
要素に対して多数の属性を設定します。 属性が既知の属性の場合、属性の値が設定されます。 属性が拡張属性の場合、'openxmlAttribute' が拡張属性リストに追加されます。 (継承元 OpenXmlElement) |
| WriteTo(XmlWriter) |
現在のノードを指定した XmlWriter に保存します。 (継承元 OpenXmlElement) |
明示的なインターフェイスの実装
| IEnumerable.GetEnumerator() | (継承元 OpenXmlElement) |