AddWord Method [InkWordList Class]

AddWord Method [InkWordList Class]

Adds a single word to the InkWordList object.



    [in] BSTR word

[Microsoft® Visual Basic® 6.0]

Public Sub AddWord( _
    word As String _



[in] The word to add to a InkWordList object. The word is not added if it already exists in the list.

For more information about the BSTR data type, see Using the Automation Library.

Return Value

HRESULT valueDescription
S_FALSEThe word already exists in the list.
E_OUTOFMEMORYCannot allocate memory to complete the operation.
E_FAILAn unspecified error occurred.
E_POINTERA parameter contained an invalid pointer.
E_INK_EXCEPTIONAn exception occurred inside the method.


If a string is added to a word list, its capitalized versions are also implicitly added. For instance, adding "hello" implicitly adds "Hello" and "HELLO".


[Visual Basic 6.0]

This Visual Basic 6.0 example adds a word to a InkWordList object, theWordList, assigned to the default InkRecognizerContext object.

Private Sub AddAWord()
    Dim theRecognizers As New InkRecognizers
    Dim theRecognizer As IInkRecognizer
    Set theRecognizer = theRecognizers.GetDefaultRecognizer
    Dim theRecognizerContext As InkRecognizerContext
    Set theRecognizerContext = theRecognizer.CreateRecognizerContext
    Dim theWordList As InkWordList
    Set theWordList = New InkWordList
    theWordList.AddWord ("Microsoft")
    Set theRecognizerContext.wordlist = theWordList
End Sub

Applies To

Related Topics