Class TablesOfAuthorities (Word VBA)

A collection of TableOfAuthorities objects (TOA fields) that represents the tables of authorities in a document. To use a TablesOfAuthorities class variable it first needs to be instantiated, for example


Dim toas as TablesOfAuthorities
Set toas = ActiveDocument.TablesOfAuthorities

For Each

Here is an example of processing the TablesOfAuthorities items in a collection.


Dim toasTablesOfAuthority As TableOfAuthorities
For Each toasTablesOfAuthority In ActiveDocument.TablesOfAuthorities
	
Next toasTablesOfAuthority

Add

Returns a TableOfAuthorities object that represents a table of authorities added to a document.

A table of authorities is built from Table of Authorities Entry (TA) fields in a document. Use the MarkCitation method to mark citations to be included in the table of authorities.

Add (Range, Category, Bookmark, Passim, KeepEntryFormatting, Separator, IncludeSequenceName, EntrySeparator, PageRangeSeparator, IncludeCategoryHeader, PageNumberSeparator)


Set myRange = ActiveDocument.Range(0, 0) 
ActiveDocument.TablesOfAuthorities.Add Range:=myRange, _ 
 Passim:= True, Category:= 0, EntrySeparator:= ", "

Arguments

The following argument is required

Range (Range) - The range where you want the table of authorities to appear. The table of authorities replaces the range, if the range isn't collapsed.

Optional arguments

The following arguments are optional

Category (Category) - The category of entries you want to include in the table of authorities. Corresponds to the \c switch for a Table of Authorities (TOA) field. Values 0 through 16 correspond to the items listed in the Category box on the Table of Authorities tab in the Index and Tables dialog box (Reference command, Insert menu). The default value is 1.

Bookmark (Bookmark) - The string name of the bookmark from which you want to collect entries for the table of authorities. If Bookmark is specified, the entries are collected only from the portion of the document marked by the bookmark. Corresponds to the \b switch for a Table of Authorities (TOA) field.

Passim (Boolean) - True to replace five or more page references to the same authority with Passim in the table of authorities. Corresponds to the \p switch for a Table of Authorities (TOA) field. If this argument is omitted, Passim is assumed to be False.

KeepEntryFormatting (Boolean) - True to apply formatting from table of authorities entries to the entries in the table of authorities. Corresponds to the \f switch for a Table of Authorities (TOA) field. If this argument is omitted, KeepEntryFormatting is assumed to be True.

Separator (String) - The characters (up to five) between each sequence number and its page number in the table of authorities. Corresponds to the \d switch for a Table of Authorities (TOA) field. If argument is omitted, a hyphen (-) is used.

IncludeSequenceName (String) - A string that specifies the Sequence (SEQ) field identifier for the table of authorities. Corresponds to the \s switch for a Table of Authorities (TOA) field.

EntrySeparator (String) - The characters (up to five) that separate each entry and its page number in the table of authorities. Corresponds to the \e switch for a Table of Authorities (TOA) field. If this argument is omitted, no separator is used.

PageRangeSeparator (String) - The characters (up to five) that separate the beginning and ending page numbers in each page range the table of authorities. Corresponds to the \g switch for a Table of Authorities (TOA) field. If this argument is omitted, an en dash is used.

IncludeCategoryHeader (Boolean) - True to have the category name for each group of entries appear in the table of authorities (for example, Cases). Corresponds to the \h switch for a Table of Authorities (TOA) field. If this argument is omitted, IncludeCategoryHeader is assumed to be True.

PageNumberSeparator (String) - The characters (up to five) that separate individual page numbers within page references in the table of authorities. Corresponds to the \l switch for a Table of Authorities (TOA) field. If this argument is omitted, a comma and a space are used.

Count

Returns a Long that represents the number of tables of authorities in the collection.


Dim lngCount As Long
lngCount = ActiveDocument.TablesOfAuthorities.Count

Format

Returns or sets the formatting for the tables of authorities in the specified document. Possible return values are wdTOAClassic - Classic formatting, wdTOADistinctive - Distinctive formatting, wdTOAFormal - Formal formatting, wdTOASimple - Simple formatting, wdTOATemplate - Template formatting.


ActiveDocument.TablesOfAuthorities.Format = wdTOAClassic

Item

Returns an individual TableOfAuthorities object in a collection.

Item (Index)

Index: The individual object to be returned. Can be a Long indicating the ordinal position of the individual object.


Dim toasTablesOfAuthority As TableOfAuthorities
Set toasTablesOfAuthority = ActiveDocument.TablesOfAuthorities(Index:=1)

MarkAllCitations

Inserts a TA (Table of Authorities Entry) field after all instances of the ShortCitation text.

MarkAllCitations (ShortCitation, LongCitation, LongCitationAutoText, Category)


ActiveDocument.TablesOfAuthorities.MarkAllCitations _ 
 ShortCitation:="Forrester v. Craddock", Category:=1, _ 
 LongCitation:="Forrester v. Craddock, 51 Wn. 2d 315 (1957)"

Arguments

The following argument is required

ShortCitation (String) - The short citation for the entry as it will appear in the Mark Citation dialog box (Insert menu, Index and Tables command).

Optional arguments

The following arguments are optional

LongCitation (String) - The long citation string for the entry as it will appear in the table of authorities.

LongCitationAutoText (String) - The AutoText entry name that contains the text of the long citation as it will appear in the table of authorities.

Category (Category) - The category number to be associated with the entry: 1 corresponds to the first category in the Category box in the Mark Citation dialog box, 2 corresponds to the second category, and so on.

MarkCitation

Inserts a TA (Table of Authorities Entry) field and returns the field as a Field object.

MarkCitation (Range, ShortCitation, LongCitation, LongCitationAutoText, Category)


ActiveDocument.TablesOfAuthorities.MarkCitation _ 
 Range:=Selection.Range, ShortCitation:=Selection.Range.Text, _ 
 LongCitation:="Forrester v. Craddock", Category:=1

Arguments

The following arguments are required:

Range (Range) - The location of the table of authorities entry. The TA field is inserted after Range.

ShortCitation (String) - The short citation for the entry as it will appear in the Mark Citation dialog box (Insert menu, Index and Tables command).

Optional arguments

The following arguments are optional

LongCitation (String) - The long citation for the entry as it will appear in the table of authorities.

LongCitationAutoText (String) - The name of the AutoText entry that contains the text of the long citation as it will appear in the table of authorities.

Category (Category) - The category number to be associated with the entry: 1 corresponds to the first category in the Category box in the Mark Citation dialog box, 2 corresponds to the second category, and so on.

NextCitation

Finds and selects the next instance of the text specified by the ShortCitation parameter.

NextCitation (ShortCitation)

ShortCitation: The text of the short citation.


ActiveDocument.TablesOfAuthorities.NextCitation _ 
 ShortCitation:="in re"