Export (0) Print
Expand All
Expand Minimize

AddWord Method [InkWordList Class]

AddWord Method [InkWordList Class]

Adds a single word to the InkWordList object.

Declaration

[C++]

HRESULT AddWord(
    [in] BSTR word
);

[Microsoft® Visual Basic® 6.0]

Public Sub AddWord( _
    word As String _
)

Parameters

word

[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_OKSuccess.
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.

Remarks

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".

Example

[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

Show:
© 2015 Microsoft