Public WithEvents RC As SpSharedRecoContext
Public myGrammar As ISpeechRecoGrammar
Private Sub Form_Load ()
On Error GoTo err_Handler
Set the RC=New SpSharedRecoContext
The Set myGrammar=RC. CreateGrammar
MyGrammar. DictationSetState SGDSActive
Err_Handler:
MsgBox Err. The Description
Stop
Resume
End Sub
Private Sub RC_Recognition (ByVal StreamNumber As Long, ByVal StreamPosition As the Variant, ByVal RecognitionType As SpeechLib. SpeechRecognitionType, ByVal Result As SpeechLib. ISpeechRecoResult)
Text1. Text=Result. PhraseInfo. GetText
End Sub