返回 String 类型的值,表示指定命令的值。
expression.queryCommandValue(cmdID)
expression 必选。返回“应用于”列表中的对象之一的表达式。
cmdID 必选,String 类型。代表命令标识符。
以下示例显示指定命令的当前值。
Sub QueryCommand() 'Determines the value of a specified command Dim objApp As FrontPage.Application Dim objDoc As DispFPHTMLDocument Dim strUser As String Dim strValue As String Set objApp = FrontPage.Application Set objDoc = objApp.ActiveDocument 'Prompt user to enter command name. strUser = InputBox("Enter a command identifier to be executed.") 'Run the associated command. strValue = objDoc.queryCommandValue(strUser) MsgBox "The value of the command is: " & strValue End Sub