[]
Specifies the type of an ITextRange.
An ITextRange has a hierarchical structure: Body contains Paragraphs, and each Paragraph contains Runs. Use Type to determine the type of a given text range.
public enum TextRangeType
Public Enum TextRangeType
IShape shape = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 1, 1, 200, 100);
ITextRange body = shape.TextFrame.TextRange;
TextRangeType bodyType = body.Type;
body.Paragraphs.Add("Hello");
TextRangeType paragraphType = body.Paragraphs[0].Type;
body.Paragraphs[0].Runs.Add("World");
TextRangeType runType = body.Paragraphs[0].Runs[0].Type;
| Name | Description |
|---|---|
| Body | Specifies the body type. |
| Paragraph | Specifies the paragraph type. |
| Run | Specifies the run type. |