Indexes.Add MethodÂ
Returns a Index object that represents a new index added to a document.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)
Usage
Dim Range As Range
Dim HeadingSeparator As Object
Dim RightAlignPageNumbers As Object
Dim Type As Object
Dim NumberOfColumns As Object
Dim AccentedLetters As Object
Dim SortBy As Object
Dim IndexLanguage As Object
Dim returnValue As Index
Dim indexes1 As Indexes
returnValue = indexes1.Add(Range, HeadingSeparator, RightAlignPageNumbers, Type, NumberOfColumns, AccentedLetters, SortBy, IndexLanguage)
Syntax
Function Add( _
<InAttribute()> ByVal Range As Range, _
<InAttribute()> Optional ByRef HeadingSeparator As Object, _
<InAttribute()> Optional ByRef RightAlignPageNumbers As Object, _
<InAttribute()> Optional ByRef Type As Object, _
<InAttribute()> Optional ByRef NumberOfColumns As Object, _
<InAttribute()> Optional ByRef AccentedLetters As Object, _
<InAttribute()> Optional ByRef SortBy As Object, _
<InAttribute()> Optional ByRef IndexLanguage As Object _
) As Index
Index Add(
[In] Range Range,
[In, Optional] ref object HeadingSeparator,
[In, Optional] ref object RightAlignPageNumbers,
[In, Optional] ref object Type,
[In, Optional] ref object NumberOfColumns,
[In, Optional] ref object AccentedLetters,
[In, Optional] ref object SortBy,
[In, Optional] ref object IndexLanguage
);
public: Index^ Add(
Range^ Range,
&Object^ HeadingSeparator,
&Object^ RightAlignPageNumbers,
&Object^ Type,
&Object^ NumberOfColumns,
&Object^ AccentedLetters,
&Object^ SortBy,
&Object^ IndexLanguage
);
public Index Add(
/*in*/Range Range,
/*in*/System.Object HeadingSeparator,
/*in*/System.Object RightAlignPageNumbers,
/*in*/System.Object Type,
/*in*/System.Object NumberOfColumns,
/*in*/System.Object AccentedLetters,
/*in*/System.Object SortBy,
/*in*/System.Object IndexLanguage
);
function Add(
Range : Range,
HeadingSeparator : Object,
RightAlignPageNumbers : Object,
Type : Object,
NumberOfColumns : Object,
AccentedLetters : Object,
SortBy : Object,
IndexLanguage : Object
) : Index;
Parameters
- Range
Required Range object. The range where you want the index to appear. The index replaces the range, if the range isn't collapsed.
- HeadingSeparator
Optional Object.The text between alphabetic groups (entries that start with the same letter) in the index. Can be one of the following WdHeadingSeparator constants: wdHeadingSeparatorBlankLine, wdHeadingSeparatorLetter, wdHeadingSeparatorLetterFull, wdHeadingSeparatorLetterLow, or wdHeadingSeparatorNone.
- RightAlignPageNumbers
Optional Object. True to align page numbers with the right margin.
- Type
Optional Object. Specifies whether subentries are on the same line (run-in) as the main entry or on a separate line (indented) from the main entry. Can be either of the following WdIndexType constants: wdIndexIndent or wdIndexRunin.
- NumberOfColumns
Optional Object. The number of columns for each page of the index. Specifying 0 (zero) sets the number of columns in the index to the same number as in the document.
- AccentedLetters
Optional Object. True to include separate headings for accented letters in the index (for example, words that begin with "Ă€" and words that begin with "A" are listed under separate headings).
- SortBy
Optional Object. The sorting criteria to be used for the specified index. Can be either of the following WdIndexSortBy constants: wdIndexSortByStroke or wdIndexSortBySyllable.
- IndexLanguage
Optional Object. The sorting language to be used for the specified index. Can be any of the WdLanguageID constants.
Remarks
An index is built from Index Entry (XE) fields in a document. Use the MarkEntry method to mark index entries to be included in an index.
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.
Platforms
Development Platforms
Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000
Target Platforms
See Also
Reference
Indexes Interface
Microsoft.Office.Interop.Word Namespace