Class Range (Word VBA)

The class Range represents a contiguous area in a document. Each Range object is defined by a starting and ending character position.

The main procedures of class Range are Copy, Delete and Select

Set

To use a Range class variable it first needs to be instantiated, for example

Dim rng as Range
Set rng = ActiveDocument.Range()

The following procedures can be used to set variables of type Range: Document.Characters, Characters, Selection.Characters, Document.GrammaticalErrors, Document.SpellingErrors, GrammaticalErrors, SpellingErrors, AutoTextEntry.Insert, Bookmark.Range, Break.Range, BuildingBlock.Insert, Cell.Range, Characters.Item, Characters.First, Characters.Last, CoAuthLock.Range, CoAuthUpdate.Range, Comment.Range, Comment.Reference, Comment.Scope, Conflict.Range, ContentControl.Range, Document.Range, Document.Content, Document.GoTo, Editor.Range, Editor.NextRange, Endnote.Range, Endnote.Reference, Endnotes.Separator, Endnotes.ContinuationNotice, Endnotes.ContinuationSeparator, Envelope.Address, Envelope.ReturnAddress, Field.Code, Field.Result, Footnote.Range, Footnote.Reference, Footnotes.Separator, Footnotes.ContinuationNotice, Footnotes.ContinuationSeparator, FormField.Range, Frame.Range, HeaderFooter.Range, HTMLDivision.Range, Hyperlink.Range, Index.Range, InlineShape.Range, Line.Range, List.Range, MailMergeField.Code, OMath.Range, OMathBreak.Range, OMathFunction.Range, OMaths.Add, Paragraph.Range, ProofreadingErrors.Item, Next, Previous, GoTo, Duplicate, GoToNext, GoToPrevious, FormattedText, GoToEditableRange, NextStoryRange, Rectangle.Range, RepeatingSectionItem.Range, Revision.Range, Revision.MovedRange, Row.Range, Row.ConvertToText, Rows.ConvertToText, Section.Range, Selection.Range, Selection.Next, Selection.Previous, Selection.GoTo, Selection.GoToNext, Selection.GoToPrevious, Selection.FormattedText, Selection.GoToEditableRange, Sentences.Item, Sentences.First, Sentences.Last, Series.Values, Series.XValues, Shape.Anchor, ShapeRange.Anchor, StoryRanges.Item, Subdocument.Range, Table.Range, Table.ConvertToText, TableOfAuthorities.Range, TableOfContents.Range, TableOfFigures.Range, TextFrame.ContainingRange, TextFrame.TextRange, Window.RangeFromPoint, Words.Item, Words.First, Words.Last, XMLNode.Range, Document.Sentences, Sentences, Selection.Sentences, Document.StoryRanges, Document.Words, Words and Selection.Words

For Each

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

Dim rngCharacter As Range
Dim iFontSize As Integer: iFontSize = 8
For Each rngCharacter In ActiveDocument.Words(1).Characters
    rngCharacter.Font.Size = iFontSize
    iFontSize = iFontSize + 2
Next rngCharacter

Themes

Some procedures in this class have been grouped together in themes and are described on separate theme pages

Format with its procedures AutoFormat, Borders, CharacterStyle, CharacterWidth, FitTextWidth, Font, FormattedText, HighlightColorIndex, Information, ListFormat, ListStyle, PageSetup, ParagraphFormat, ParagraphStyle, PasteAndFormat, Style, TableStyle and TextVisibleOnScreen
Import/Export with its procedures ExportAsFixedFormat, ExportAsFixedFormat2, ExportFragment and ImportFragment

Methods

These are the main methods of the Range class

Copy - Copies the specified range to the Clipboard.

ActiveDocument.Range.Copy

Delete - Deletes the specified number of characters or words.

Dim lngDelete As Long
lngDelete = ActiveDocument.Range.Delete()

Select - Selects the specified range.

ActiveDocument.Range.Select

Other Methods

CheckSpelling - Begins a spelling check for the specified document or range.

ActiveDocument.Range.CheckSpelling

Collapse - Collapses a range or selection to the starting or ending position. After a range or selection is collapsed, the starting and ending points are equal.

ActiveDocument.Range.Collapse

ConvertHangulAndHanja - Converts the specified range from hangul to hanja or vice versa.

ActiveDocument.Range.ConvertHangulAndHanja

ConvertToTable - Converts text within a range to a table. Returns the table as a Table object.

Dim tblConvertToTable As Table
Set tblConvertToTable = ActiveDocument.Range.ConvertToTable()

EndOf - Moves or extends the ending character position of a range to the end of the nearest specified text unit.

Dim lngEndOf As Long
lngEndOf = ActiveDocument.Range.EndOf()

GetSpellingSuggestions - Returns a SpellingSuggestions collection that represents the words suggested as spelling replacements for the first word in the specified range.

Dim sssGetSpellingSuggestions As SpellingSuggestions
Set sssGetSpellingSuggestions = ActiveDocument.Range.GetSpellingSuggestions()

GoTo - Returns a Range object that represents the start position of the specified item, such as a page, bookmark, or field.

Dim rngGoTo As Range
Set rngGoTo = ActiveDocument.Range.GoTo()

InsertAlignmentTab - Inserts an absolute tab that is always positioned in the same spot, relative to either the margins or indents.

Dim lngAlignment As Long: lngAlignment =  
ActiveDocument.Range.InsertAlignmentTab Alignment:=lngAlignment

InsertCrossReference - Inserts a cross-reference to a heading, bookmark, footnote, or endnote, or to an item for which a caption label is defined (for example, an equation, figure, or table).

Dim strReferenceItem As String: strReferenceItem =  
ActiveDocument.Range.InsertCrossReference ReferenceType:=wdRefTypeBookmark, ReferenceKind:=wdContentText, ReferenceItem:=strReferenceItem

InsertDatabase - Retrieves data from a data source (for example, a separate Microsoft Word document, a Microsoft Excel worksheet, or a Microsoft Access database) and inserts the data as a table in place of the specified range.

ActiveDocument.Range.InsertDatabase

InsertDateTime - Inserts the current date or time, or both, either as text or as a TIME field.

ActiveDocument.Range.InsertDateTime

InsertFile - Inserts all or part of the specified file.

Dim strFileName As String: strFileName =  
ActiveDocument.Range.InsertFile FileName:=strFileName

InsertSymbol - Inserts a symbol in place of the specified range.

Dim lngCharacterNumber As Long: lngCharacterNumber =  
ActiveDocument.Range.InsertSymbol CharacterNumber:=lngCharacterNumber

InsertXML - Inserts the specified XML into the document at the specified range, replacing any text contained within the range.

Dim strXML As String: strXML =  
ActiveDocument.Range.InsertXML XML:=strXML

ModifyEnclosure - Adds, modifies, or removes an enclosure around the specified character or characters.

ActiveDocument.Range.ModifyEnclosure Style:=

Move - Collapses the specified range to its start or end position and then moves the collapsed object by the specified number of units.

Dim lngMove As Long
lngMove = ActiveDocument.Range.Move()

MoveEnd - Moves the ending character position of a range.

Dim lngMoveEnd As Long
lngMoveEnd = ActiveDocument.Range.MoveEnd()

MoveEndUntil - Moves the end position of the specified range until any of the specified characters are found in the document. If the movement is forward in the document, the range is expanded.

Dim lngMoveEndUntil As Long
lngMoveEndUntil = ActiveDocument.Range.MoveEndUntil(Cset:=)

MoveEndWhile - Moves the ending character position of a range while any of the specified characters are found in the document.

Dim strCset As String: strCset =  
Dim lngMoveEndWhile As Long
lngMoveEndWhile = ActiveDocument.Range.MoveEndWhile(Cset:=strCset)

MoveStart - Moves the start position of the specified range.

Dim lngMoveStart As Long
lngMoveStart = ActiveDocument.Range.MoveStart()

MoveStartUntil - Moves the start position of the specified range until one of the specified characters is found in the document.

Dim strCset As String: strCset =  
Dim lngMoveStartUntil As Long
lngMoveStartUntil = ActiveDocument.Range.MoveStartUntil(Cset:=strCset)

MoveStartWhile - Moves the start position of the specified range while any of the specified characters are found in the document.

Dim strCset As String: strCset =  
Dim lngMoveStartWhile As Long
lngMoveStartWhile = ActiveDocument.Range.MoveStartWhile(Cset:=strCset)

MoveUntil - Moves the specified range until one of the specified characters is found in the document.

Dim strCset As String: strCset =  
Dim lngMoveUntil As Long
lngMoveUntil = ActiveDocument.Range.MoveUntil(Cset:=strCset)

MoveWhile - Moves the specified range while any of the specified characters are found in the document.

Dim strCset As String: strCset =  
Dim lngMoveWhile As Long
lngMoveWhile = ActiveDocument.Range.MoveWhile(Cset:=strCset)

Next - Returns a Range object that represents the specified unit relative to the specified range.

Dim rngNext As Range
Set rngNext = ActiveDocument.Range.Next()

PasteExcelTable - Pastes and formats a Microsoft Excel table.

ActiveDocument.Range.PasteExcelTable LinkedToExcel:=True, WordFormatting:=True, RTF:=True

PasteSpecial - Inserts the contents of the Clipboard.

ActiveDocument.Range.PasteSpecial

PhoneticGuide - Adds phonetic guides to the specified range.

Dim strText As String: strText =  
ActiveDocument.Range.PhoneticGuide Text:=strText

Previous - Returns the previous range a relative to the specified range.

Dim rngPrevious As Range
Set rngPrevious = ActiveDocument.Range.Previous()

SetRange - Sets the starting and ending character positions for an existing range.

Dim lngStart As Long: lngStart = 
Dim lngEnd As Long: lngEnd =  
ActiveDocument.Range.SetRange Start:=lngStart, End:=lngEnd

StartOf - Moves or extends the start position of the specified range or selection to the beginning of the nearest specified text unit. This method returns a Long that indicates the number of characters by which the range or selection was moved or extended. The method returns a negative number if the movement is backward through the document.

Dim lngStartOf As Long
lngStartOf = ActiveDocument.Range.StartOf()

TCSCConverter - Converts the specified range from Traditional Chinese to Simplified Chinese or vice versa.

ActiveDocument.Range.TCSCConverter

Properties

Characters.Count returns the number of characters in the Characters collection.

Dim lngCount As Long
lngCount = ActiveDocument.Range.Characters.Count

Characters.First returns a Range object that represents the first character in the collection.

Dim rngFirst As Range
Set rngFirst = ActiveDocument.Range.Characters.First

Characters.Last returns a Range object that represents the last character in the collection.

Dim rngLast As Range
Set rngLast = ActiveDocument.Range.Characters.Last

Characters.Parent returns an object that represents the parent object of the specified Characters object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.Characters.Parent

ProofreadingErrors.Count returns a Long that represents the number of proofreading errors in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.SpellingErrors.Count

ProofreadingErrors.Parent returns an object that represents the parent object of the specified ProofreadingErrors object.

Dim objParent As Object
Set objParent = ActiveDocument.SpellingErrors.Parent

ProofreadingErrors.Type returns the type of proofreading error.

Dim wpeType As WdProofreadingErrorType
wpeType = ActiveDocument.SpellingErrors.Type

Bold true if the range is formatted as bold.

ActiveDocument.Range.Bold =

BoldBi true if the font or range is formatted as bold. Returns True, False, or wdUndefined (for a mixture of bold and non-bold text). Can be set to True, False, or wdToggle.

ActiveDocument.Range.BoldBi =

BookmarkID returns the number of the bookmark that encloses the beginning of the specified range; returns 0 (zero) if there is no corresponding bookmark.

Dim lngBookmarkID As Long
lngBookmarkID = ActiveDocument.Range.BookmarkID

Bookmarks returns a Bookmarks collection that represents all the bookmarks in a document, range, or selection.

Dim bkmsBookmarks As Bookmarks
Set bkmsBookmarks = ActiveDocument.Range.Bookmarks

Case returns or sets a WdCharacterCase constant that represents the case of the text in the specified range.

ActiveDocument.Range.Case = wdFullWidth

Cells returns a Cells collection that represents the table cells in a range.

Dim cllsCells As Cells
Set cllsCells = ActiveDocument.Range.Cells

Characters returns a Characters collection that represents the characters in a range.

Dim chrsCharacters As Characters
Set chrsCharacters = ActiveDocument.Range.Characters

Columns returns a Columns collection that represents all the table columns in the range.

Dim clmsColumns As Columns
Set clmsColumns = ActiveDocument.Range.Columns

CombineCharacters true if the specified range contains combined characters.

ActiveDocument.Range.CombineCharacters = True

Comments returns a Comments collection that represents all the comments in the specified document, selection, or range.

Dim cmmsComments As Comments
Set cmmsComments = ActiveDocument.Range.Comments

Conflicts returns a Conflicts collection object that contains all the conflict objects in the range.

Dim cnfsConflicts As Conflicts
Set cnfsConflicts = ActiveDocument.Range.Conflicts

ContentControls returns a ContentControls collection that represents the content controls contained within a range.

Dim ccsContentControls As ContentControls
Set ccsContentControls = ActiveDocument.Range.ContentControls

DisableCharacterSpaceGrid true if Microsoft Word ignores the number of characters per line for the corresponding Range object.

ActiveDocument.Range.DisableCharacterSpaceGrid = True

Document returns a Document object associated with the specified range.

Dim docDocument As Document
Set docDocument = ActiveDocument.Range.Document

Duplicate returns a read-only Range object that represents all the properties of the specified range.

Dim rngDuplicate As Range
Set rngDuplicate = ActiveDocument.Range.Duplicate

Editors returns an Editors object that represents all the users authorized to modify a selection or range within a document.

Dim edtsEditors As Editors
Set edtsEditors = ActiveDocument.Range.Editors

EmphasisMark returns or sets the emphasis mark for a character or designated character string.

ActiveDocument.Range.EmphasisMark = wdEmphasisMarkNone

End returns or sets the ending character position of a range.

ActiveDocument.Range.End =

EndnoteOptions returns an EndnoteOptions object that represents the endnotes in a range.

Dim eosEndnoteOptions As EndnoteOptions
Set eosEndnoteOptions = ActiveDocument.Range.EndnoteOptions

Endnotes returns an Endnotes collection that represents all the endnotes in a range.

Dim endsEndnotes As Endnotes
Set endsEndnotes = ActiveDocument.Range.Endnotes

EnhMetaFileBits returns a Variant that represents a picture representation of how a range of text appears.

Dim varEnhMetaFileBits As Variant
varEnhMetaFileBits = ActiveDocument.Range.EnhMetaFileBits

Fields returns a Fields collection that represents all the fields in the range.

Dim fldsFields As Fields
Set fldsFields = ActiveDocument.Range.Fields

Find returns a Find object that contains the criteria for a find operation.

Dim fndFind As Find
Set fndFind = ActiveDocument.Range.Find

FootnoteOptions returns FootnoteOptions object that represents the footnotes in a selection or range.

Dim fosFootnoteOptions As FootnoteOptions
Set fosFootnoteOptions = ActiveDocument.Range.FootnoteOptions

Footnotes returns a Footnotes collection that represents all the footnotes in a range.

Dim ftnsFootnotes As Footnotes
Set ftnsFootnotes = ActiveDocument.Range.Footnotes

FormFields returns a FormFields collection that represents all the form fields in the range.

Dim ffsFormFields As FormFields
Set ffsFormFields = ActiveDocument.Range.FormFields

Frames returns a Frames collection that represents all the frames in a range.

Dim frmsFrames As Frames
Set frmsFrames = ActiveDocument.Range.Frames

GrammarChecked true if a grammar check has been run on the specified range or document.

ActiveDocument.Range.GrammarChecked = True

GrammaticalErrors returns a ProofreadingErrors collection that represents the sentences that failed the grammar check on the specified document or range.

Dim pesGrammaticalErrors As ProofreadingErrors
Set pesGrammaticalErrors = ActiveDocument.Range.GrammaticalErrors

HorizontalInVertical returns or sets the formatting for horizontal text set within vertical text.

ActiveDocument.Range.HorizontalInVertical = wdHorizontalInVerticalFitInLine

HTMLDivisions returns an HTMLDivisions object that represents an HTML division in a web document.

Dim htmsHTMLDivisions As HTMLDivisions
Set htmsHTMLDivisions = ActiveDocument.Range.HTMLDivisions

Hyperlinks returns a Hyperlinks collection that represents all the hyperlinks in the specified range.

Dim hypsHyperlinks As Hyperlinks
Set hypsHyperlinks = ActiveDocument.Range.Hyperlinks

ID returns or sets the identification name for the specified range.

ActiveDocument.Range.ID =

InlineShapes returns an InlineShapes collection that represents all the InlineShape objects in a range.

Dim issInlineShapes As InlineShapes
Set issInlineShapes = ActiveDocument.Range.InlineShapes

IsEndOfRowMark true if the specified range is collapsed and is located at the end-of-row mark in a table.

Dim booIsEndOfRowMark As Boolean
booIsEndOfRowMark = ActiveDocument.Range.IsEndOfRowMark

Italic true if the font or range is formatted as italic.

ActiveDocument.Range.Italic =

ItalicBi true if the font or range is formatted as italic.

ActiveDocument.Range.ItalicBi =

Kana returns or sets whether the specified range of Japanese language text is hiragana or katakana.

ActiveDocument.Range.Kana = wdKanaHiragana

LanguageDetected returns or sets a value that specifies whether Microsoft Word has detected the language of the specified text.

ActiveDocument.Range.LanguageDetected = True

LanguageID returns or sets a WdLanguageID constant that represents the language for the specified range.

ActiveDocument.Range.LanguageID = wdAfrikaans

LanguageIDFarEast returns or sets an East Asian language for the specified object.

ActiveDocument.Range.LanguageIDFarEast = wdAfrikaans

LanguageIDOther returns or sets the language for the specified range.

ActiveDocument.Range.LanguageIDOther = wdAfrikaans

ListParagraphs returns a ListParagraphs collection that represents all the numbered paragraphs in the range.

Dim lpsListParagraphs As ListParagraphs
Set lpsListParagraphs = ActiveDocument.Range.ListParagraphs

Locks returns a CoAuthLocks collection object that represents all the locks in the range.

Dim calsLocks As CoAuthLocks
Set calsLocks = ActiveDocument.Range.Locks

NextStoryRange returns a Range object that refers to the next story.

Dim rngNextStoryRange As Range
Set rngNextStoryRange = ActiveDocument.Range.NextStoryRange

NoProofing true if the spelling and grammar checker ignores the specified text.

ActiveDocument.Range.NoProofing =

OMaths returns an OMaths collection that represents the OMath objects within the specified range.

Dim omsOMaths As OMaths
Set omsOMaths = ActiveDocument.Range.OMaths

Orientation returns or sets the orientation of text in a range when the Text Direction feature is enabled.

ActiveDocument.Range.Orientation = wdTextOrientationDownward

Paragraphs returns a Paragraphs collection that represents all the paragraphs in the specified range.

Dim prgsParagraphs As Paragraphs
Set prgsParagraphs = ActiveDocument.Range.Paragraphs

Parent returns an object that represents the parent object of the specified Range object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.Parent

ParentContentControl returns a ContentControl object that represents the parent content control for the specified range.

Dim cclParentContentControl As ContentControl
Set cclParentContentControl = ActiveDocument.Range.ParentContentControl

PreviousBookmarkID returns the number of the last bookmark that starts before or at the same place as the specified range.

Dim lngPreviousBookmarkID As Long
lngPreviousBookmarkID = ActiveDocument.Range.PreviousBookmarkID

ReadabilityStatistics returns a ReadabilityStatistics collection that represents the readability statistics for the specified document or range.

Dim rssReadabilityStatistics As ReadabilityStatistics
Set rssReadabilityStatistics = ActiveDocument.Range.ReadabilityStatistics

Revisions returns a Revisions collection that represents the tracked changes in the range.

Dim rvsRevisions As Revisions
Set rvsRevisions = ActiveDocument.Range.Revisions

Rows returns a Rows collection that represents all the table rows in a range.

Dim rwsRows As Rows
Set rwsRows = ActiveDocument.Range.Rows

Scripts returns a Scripts collection that represents the collection of HTML scripts in the specified object.

Dim scrsScripts As Office.Scripts
scrsScripts = ActiveDocument.Range.Scripts

Sections returns a Sections collection that represents the sections in the specified range.

Dim sctsSections As Sections
Set sctsSections = ActiveDocument.Range.Sections

Sentences returns a Sentences collection that represents all the sentences in the range.

Dim sntsSentences As Sentences
Set sntsSentences = ActiveDocument.Range.Sentences

Shading returns a Shading object that refers to the shading formatting for the specified object.

Dim shdShading As Shading
Set shdShading = ActiveDocument.Range.Shading

ShapeRange returns a ShapeRange collection that represents all the Shape objects in the specified range.

Dim sreShapeRange As ShapeRange
Set sreShapeRange = ActiveDocument.Range.ShapeRange

ShowAll true if all nonprinting characters (such as hidden text, tab marks, space marks, and paragraph marks) are displayed.

ActiveDocument.Range.ShowAll = True

SpellingChecked true if spelling has been checked throughout the specified range or document. False if all or some of the range or document has not been checked for spelling.

ActiveDocument.Range.SpellingChecked = True

SpellingErrors returns a ProofreadingErrors collection that represents the words identified as spelling errors in the specified range.

Dim pesSpellingErrors As ProofreadingErrors
Set pesSpellingErrors = ActiveDocument.Range.SpellingErrors

Start returns or sets the starting character position of a range.

ActiveDocument.Range.Start =

StoryLength returns the number of characters in the story that contains the specified range.

Dim lngStoryLength As Long
lngStoryLength = ActiveDocument.Range.StoryLength

StoryType returns the story type for the specified range, selection, or bookmark.

Dim wstStoryType As WdStoryType
wstStoryType = ActiveDocument.Range.StoryType

Subdocuments returns a Subdocuments collection that represents all the subdocuments in the specified range or document.

Dim sbdsSubdocuments As Subdocuments
Set sbdsSubdocuments = ActiveDocument.Range.Subdocuments

SynonymInfo returns a SynonymInfo object that contains information from the thesaurus on synonyms, antonyms, or related words and expressions for the contents of a range.

Dim sioSynonymInfo As SynonymInfo
Set sioSynonymInfo = ActiveDocument.Range.SynonymInfo

Tables returns a Tables collection that represents all the tables in the specified range.

Dim tblsTables As Tables
Set tblsTables = ActiveDocument.Range.Tables

Text returns or sets the text in the specified range or selection. Read/write String.

ActiveDocument.Range.Text =

TextRetrievalMode returns a TextRetrievalMode object that controls how text is retrieved from the specified Range.

ActiveDocument.Range.TextRetrievalMode =

TopLevelTables returns a Tables collection that represents the tables at the outermost nesting level in the current range.

Dim tblsTopLevelTables As Tables
Set tblsTopLevelTables = ActiveDocument.Range.TopLevelTables

TwoLinesInOne returns or sets whether Microsoft Word sets two lines of text in one and specifies the characters that enclose the text, if any.

ActiveDocument.Range.TwoLinesInOne = wdTwoLinesInOneAngleBrackets

Underline returns or sets the type of underline applied to a range.

ActiveDocument.Range.Underline = wdUnderlineDash

Updates returns a CoAuthUpdates collection object that represents all updates that were merged into the specified range at the last explicit save.

Dim causUpdates As CoAuthUpdates
Set causUpdates = ActiveDocument.Range.Updates

WordOpenXML returns a String that represents the XML contained within the range in the Microsoft Word Open XML format.

Dim strWordOpenXML As String
strWordOpenXML = ActiveDocument.Range.WordOpenXML

Words returns a Words collection that represents all the words in a range.

Dim wrdsWords As Words
Set wrdsWords = ActiveDocument.Range.Words

XML returns a String that represents the XML text in the specified object.

Dim strXML As String
strXML = ActiveDocument.Range.XML

Sentences.Count returns a Long that represents the number of sentences in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.Sentences.Count

Sentences.First returns a Range object that represents the first sentence in a collection of sentences within a document, range, or selection.

Dim rngFirst As Range
Set rngFirst = ActiveDocument.Sentences.First

Sentences.Last returns a Range object that represents the last sentence in a document, selection, or range.

Dim rngLast As Range
Set rngLast = ActiveDocument.Sentences.Last

Sentences.Parent returns an object that represents the parent object of the specified Sentences object.

Dim objParent As Object
Set objParent = ActiveDocument.Sentences.Parent

StoryRanges.Count returns a Long that represents the number of story ranges in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.StoryRanges.Count

StoryRanges.Parent returns an object that represents the parent object of the specified StoryRanges object.

Dim objParent As Object
Set objParent = ActiveDocument.StoryRanges.Parent

Words.Count returns a Long that represents the number of words in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.Words.Count

Words.First returns a Range object that represents the first word in a collection of words.

Dim rngFirst As Range
Set rngFirst = ActiveDocument.Words.First

Words.Last returns a Range object that represents the last word in a collection of words.

Dim rngLast As Range
Set rngLast = ActiveDocument.Words.Last

Words.Parent returns an object that represents the parent object of the specified Words object.

Dim objParent As Object
Set objParent = ActiveDocument.Words.Parent