' Select some text in the active document prior
' to execution.
ActiveDocument.Bookmarks.Add _
Name:="myplace", Range:=Selection.Range
本示例在 sample.wps 中的第三段添加名为 third_para 的书签。然后在活动窗口中显示该文档的所有书签。
Dim myDoc As Document
' To best illustrate this example,
' sample.wps must be opened, not active,
' and contain more than 3 paragraphs.
Set myDoc = Documents("sample.wps")
myDoc.Bookmarks.Add Name:="third_para", _
Range:=myDoc.Paragraphs(3).Range
myDoc.ActiveWindow.View.ShowBookmarks = True