queryCommandText Method

Microsoft FrontPage Visual Basic

queryCommandText Method

Returns a String that represents a text value associated with the specified command.

expression.queryCommandText(cmdID)

expression    Required. An expression that returns one of the objects in the Applies To list.

cmdID   Required. A String that represents the command identifier. For a list of available commands see the execCommand method.

Example

The following example displays the text value associated with a given command.

    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.queryCommandText(strUser)
    MsgBox "The text value associated with the specified command is: " & strValue
End Sub