[]
Base class for Range and GrapeCity.Documents.Word.RangeBase.Body that allows manipulating content in a document.
public class RangeBase : ContentObjectCollection<ContentObject>, IContentList<ContentObject>, IReadOnlyList<ContentObject>, IReadOnlyCollection<ContentObject>, IEnumerable<ContentObject>, IEnumerable
A range's content is determined by its Start and End markers. Content objects that satisfy any of the following conditions are included in the range:
Gets the collection of bidirectional overrides included in this range.
public BidirectionalOverrideCollection BidirectionalOverrides { get; }
Gets the collection of bookmarks included in this range.
public BookmarkCollection Bookmarks { get; }
Gets the collection of canvas shapes included in this range.
public CanvasShapeCollection CanvasShapes { get; }
Gets the collection of table cells included in this range.
public CellCollection Cells { get; }
Gets the collection of comments included in this range.
public CommentCollection Comments { get; }
Gets the collection of complex fields included in this range.
public ComplexFieldCollection ComplexFields { get; }
Gets the collection of content controls included in this range.
public ContentControlCollection ContentControls { get; }
Gets the DocumentBase containing this range.
public DocumentBase Document { get; }
Gets the collection of editable range objects included in this range.
public EditableRangeCollection EditableRanges { get; }
Gets the end marker of the range.
public Marker End { get; }
Gets the collection of endnotes included in this range.
public EndnoteCollection Endnotes { get; }
Gets the collection of footnotes included in this range.
public FootnoteCollection Footnotes { get; }
Gets the collection of group shapes included in this range.
public GroupShapeCollection GroupShapes { get; }
Gets the collection of hyperlinks included in this range.
public HyperlinkCollection Hyperlinks { get; }
Gets the collection of ink shapes included in this range.
public InkShapeCollection InkShapes { get; }
Gets a value indicating whether this range is alive and can be used.
If this range is a PersistentRange, this property always returns true.
If this range is a Range (created by a call to GetRange()) it can become unusable if its content is deleted. In that case this property will return false.
public bool IsAlive { get; }
Gets a value indicating whether this range is empty (does not contain any formattable content).
public bool IsEmpty { get; }
Gets the collection of OMathElement objects included in this range.
public OMathElementCollection OMathElements { get; }
Gets the collection of OMathMatrixRow objects included in this range.
public OMathMatrixRowCollection OMathMatrixRows { get; }
Gets the collection of OMathParagraph objects included in this range.
public OMathParagraphCollection OMathParagraphs { get; }
Gets the collection of OMathStruct objects included in this range.
public OMathStructCollection OMathStructs { get; }
Gets the collection of OMath objects included in this range.
public OMathCollection OMaths { get; }
Gets the collection of paragraphs included in this range.
public ParagraphCollection Paragraphs { get; }
Gets the collection of pictures included in this range.
public PictureCollection Pictures { get; }
Gets the collection of table rows included in this range.
public RowCollection Rows { get; }
Gets the collection of text runs included in this range.
public RunCollection Runs { get; }
Gets the collection of sections included in this range.
public SectionCollection Sections { get; }
Gets the collection of shapes included in this range.
public ShapeCollection Shapes { get; }
Gets the collection of simple fields included in this range.
public SimpleFieldCollection SimpleFields { get; }
Gets the start marker of the range.
public Marker Start { get; }
Gets the collection of tables included in this range.
public TableCollection Tables { get; }
Gets the text included in this range, as a string.
public string Text { get; }
Gets the collection of text frames included in this range.
public TextFrameCollection TextFrames { get; }
Gets the collection of texts included in this range.
public TextCollection Texts { get; }
Gets the collection of unknown objects included in this range.
public UnknownContentCollection Unknowns { get; }
Clears all content in this range, excluding bound markers.
public virtual void Clear()
Clears formatting on content in this range.
Note that this method does not remove formatting applied indirectly via the content hierarchy.
public void ClearFormatting()
Compares this range location with another range location.
public LocationRelation CompareLocationWith(RangeBase range)
range
RangeBaseThe range to compare this range with.
A LocationRelation value representing the result of the comparison.
Results returns compare that our current range applied on provided range
. So, for example, result Contains mean our range contains provided range.
Copies this range to another range.
public Range CopyTo(RangeBase to, InsertLocation insertLocation, FormattingCopyStrategy copyStrategy = FormattingCopyStrategy.Copy)
to
RangeBaseThe destination range.
insertLocation
InsertLocationThe target location relative to the destination range.
copyStrategy
FormattingCopyStrategyIndicates whether to preserve the source formatting.
Gets the collection of all drawing objects (derived from ShapeBase) included in this range. Drawing objects include Picture, Shape, and unknow shape types.
public ContentObjectCollection<ShapeBase> GetDrawings()
The collection of all drawing objects in this range.
Creates and returns a collection of content objects in the current range. The returned collection differs from enumerating on the current range itself in that it does not include objects that start before the current range's start and end after the current range's end.
public ContentObjectCollection<T> GetInnerCollection<T>() where T : ContentObject
The newly created ContentObjectCollection<T>.
T
The type of items in the collection.
See also remarks on RangeBase.
Creates and returns an instance of PersistentRange with bounds on the specified objects.
You should dispose the PersistentRange returned by this method when it is no longer needed. Failing to do so may lead to degraded performance.
public PersistentRange GetPersistentRange(ContentObject first, ContentObject last)
first
ContentObjectThe first content object to include in the range.
last
ContentObjectThe last content object to include in the range.
The newly created instance of PersistentRange.
Creates and returns an instance of PersistentRange with bounds on the specified markers.
You should dispose the PersistentRange returned by this method when it is no longer needed. Failing to do so may lead to degraded performance.
public PersistentRange GetPersistentRange(Marker start, Marker end)
The newly created instance of PersistentRange.
Inserts a built-in Office Math equation into the range.
public ContentObject[] InsertOMathEquation(OMathBuiltInEquation equation, InsertLocation location)
equation
OMathBuiltInEquationThe built-in equation to fill the OMath.
location
InsertLocationThe target InsertLocation for the insertion.
The array of inserted ContentObject objects.
Moves this range to another range.
public Range MoveTo(RangeBase to, InsertLocation insertLocation, FormattingCopyStrategy copyStrategy = FormattingCopyStrategy.Copy)
to
RangeBaseThe destination range.
insertLocation
InsertLocationThe target location relative to the destination range.
copyStrategy
FormattingCopyStrategyIndicates whether to preserve the source formatting.
Gets string representation of the range.
public override string ToString()
String representation of the range.
Updates the results of all document fields that support updating.
public void UpdateFields(WordLayoutSettings layoutSettings = null)
layoutSettings
WordLayoutSettingsThe WordLayoutSettings object used to create temporary instances of GcWordLayout before updating the document fields.