本示例为 Bookmarks 对象的父对象设置一个变量,并显示带有变量的对象类型名称的消息框。

Set myObject = ActiveDocument.Bookmarks.Parent
MsgBox TypeName(myObject)