Formatted |
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
public void SetListType( TextRange textRange, ListType listType )
Public Sub SetListType ( textRange As TextRange, listType As ListType )
public: void SetListType( TextRange^ textRange, ListType listType )
member SetListType : textRange : TextRange * listType : ListType -> unit
Parameters

Exception | Condition |
---|---|
ArgumentException | This text range is empty. -or- This start index of this text range is not within the text range identifying the entire text. -or- The end of this text range is not within the text range identifying the entire text. -or- This list type is not valid to set on a paragraph. |
ArgumentNullException | A non-optional argument was null |
ArgumentOutOfRangeException | A value passed for an enumeration argument is not a member of that enumeration |

This function applies the ListType to all paragraphs contained in the given range.
The following ListType options are available:
Set the list type to None if the paragraph should not be in a list.
The list type cannot be set to Mixed.
Paragraphs with a ListType other than None are considered to be 'list' paragraphs.
Consecutive list paragraphs with the same indentation level are treated as part of the same list. A list ends when a list paragraph is followed by
- a paragraph that has None
- or a list paragraph that has a lower indentation level, (i.e. is indented less)
FormattedText will keep lists consistent. That means that numbered paragraphs will automatically get sequential numbers or letters. It also means that if the list type of one paragraphs in the list is changed then that change is propagated to all the paragraphs in that list. Even if those paragraphs were not in the input text range. Note that this will not affect the list type of any nested sub-lists.
Use a vertical tab character ('\v') to insert a line without a bullet or number. Since this does not end the paragraph this will allow the list to continue to the next paragraph.