BookmarkID 属性 (Word)Selection.BookmarkID property (Word)

返回位于选定内容开始位置的书签编号。Returns the number of the bookmark that encloses the beginning of the specified selection. 只读 LongRead-only Long.

语法Syntax

expressionexpression. BookmarkID

_表达式_一个代表**Selection** 对象的变量。expression A variable that represents a Selection object.

备注Remarks

如果没有相应的书签,则返回 0(零)。Returns 0 (zero) if there is no corresponding bookmark. 编号对应于书签在文档中的位置,1 对应于第一个书签,2 对应于第二个书签,依此类推。The number corresponds to the position of the bookmark in the document—1 for the first bookmark, 2 for the second one, and so on.

示例Example

本示例显示位于选定内容的开始位置的书签编号。This example displays the number of the bookmark that encloses the beginning of the selection.

MsgBox "Bookmark " & Selection.BookmarkID

另请参阅See also

Selection 对象Selection Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.