Words 接口

定义

所选内容、 范围或文档中的单词集合。A collection of words in a selection, range, or document.

public interface class Words : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("0002095C-0000-0000-C000-000000000046")]
public interface Words : System.Collections.IEnumerable
type Words = interface
    interface IEnumerable
Public Interface Words
Implements IEnumerable
属性
实现

注解

Words集合中的每一项都是一个 Range 代表一个单词的对象。Each item in the Words collection is a Range object that represents one word. 没有 Word 的对象。There is no Word object.

使用 属性返回 文字 对象。Use the Words property to return the Words object.

使用Wordsindex ),其中 index 是索引号,返回一个Range对象,该对象表示一个单词。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.

Words 集合中的项包含字词后在单词和空格。The item in the Words collection includes both the word and the spaces after the word. 如果所选内容是插入点,并且其后紧跟一个空格,则所选内容。词(1)指的是所选内容前面的单词。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. 如果所选内容是插入点且后面紧跟一个字符,则所选内容。词(1)表示所选内容后面的单词。If the selection is the insertion point and is immediately followed by a character, Selection.Words(1) refers to the word following the selection.

Count在文档中,此集合的属性返回的只是正文中的项目数。The Count property for this collection in a document returns the number of items in the main story only. 要统计其他部分中的个数,请使用带有 Range 对象的集合。To count items in other stories use the collection with the Range object. 此外, Count 属性在合计中包括标点符号和段落标记。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.

Add方法不适用于Words集合。The Add method isn't available for the Words collection. 而是使用 InsertAfter(String) 方法或 InsertBefore(String) 方法将文本添加到Range对象。Instead, use the InsertAfter(String) method or the InsertBefore(String) method to add text to a Range object.

属性

Application

返回一个 Application 代表 Microsoft Word 应用程序的对象。Returns a Application object that represents the Microsoft Word application.

Count

返回指定集合中的项目数。Returns the number of items in the specified collection.

Creator

返回一个 32 位整数,它指示在其中创建指定的对象的应用程序。Returns a 32-bit integer that indicates the application in which the specified object was created.

First

返回一个 Range 对象,表示文档、选定内容或区域中的第一个单词。Returns a Range object that represents the first word in a document, selection or range.

Item[Int32]

返回集合中的单个对象。Returns an individual object in a collection.

Last

返回一个 Range 对象,表示文档、选定内容或区域中的最后一个单词。Returns a Range object that represents the last word in a document, selection, or range.

Parent

返回一个对象,代表指定对象的父对象。Returns an object that represents the parent object of the specified object.

方法

GetEnumerator()

适用于