ISpeechGrammarRules Add Method (SAPI 5.4)

Microsoft Speech API 5.4

Interface: ISpeechGrammarRules

Add Method

The Add method creates a new ISpeechGrammarRule object in an ISpeechGrammarRules collection.

RuleName, or RuleId, or both must be specified to identify the rule. If RuleName is specified (not an empty string such as ""), it must be unique within the grammar. If RuleId is specified (a value other than zero), it must be unique within the grammar.

  
    ISpeechGrammarRules.Add(
     RuleName As String,
     Attributes As SpeechRuleAttributes,
     [RuleId As Long = 0]
) As ISpeechGrammarRule

Parameters

  • RuleName
    Specifies the RuleName of the new rule.
  • Attributes
    Specifies the Attributes of the new rule.
  • RuleId
    Specifies the RuleId of the new rule. Default value is zero.

Return Value

The Add method returns the newly-created ISpeechGrammarRule object.