Words Interface 

A collection of words in a selection, range, or document.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Public Class ordsImplementation
    Implements Words
End Class
Dim ordsImplementation1 As New ordsImplementation()

Syntax

Public Interface Words
    Inherits IEnumerable
public interface Words : IEnumerable
public interface class Words : public IEnumerable
public interface Words implements IEnumerable
public interface Words implements IEnumerable

Remarks

Each item in the Words collection is a Range object that represents one word. There is no Word object.

Use the Words property to return the Words object.

Use Words(index), where index is the index number, to return a Range object that represents one word. The index number represents the position of the word in the Words collection.

The item in the Words collection includes both the word and the spaces after the word. If the selection is the insertion point and it is immediately followed by a space, Selection.Words(1) refers to the word preceding the selection. If the selection is the insertion point and is immediately followed by a character, Selection.Words(1) refers to the word following the selection.

The Count property for this collection in a document returns the number of items in the main story only. To count items in other stories use the collection with the Range object. Also, the Count property includes punctuation and paragraph marks in the total. If you need a count of the actual words in a document, use the Word Count dialog box.

The Add method isn't available for the Words collection. Instead, use the InsertAfter method or the InsertBefore method to add text to a Range object.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Microsoft.Office.Interop.Word Namespace

Other Resources

Words Members