Freigeben über


RemoveWord Method [InkWordList Class]

RemoveWord Method [InkWordList Class]

Removes a single word from an InkWordList.

Declaration

[C++]

HRESULT RemoveWord(
    [in] BSTR word
);

[Microsoft® Visual Basic® 6.0]

Public Sub RemoveWord( _
    word As String _
)

Parameters

word

[in] The word to remove from the InkWordList.

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

Return Value

HRESULT value Description
S_OK Success.
E_OUTOFMEMORY Cannot allocate memory to complete the operation.
E_FAIL An unspecified error occurred.
E_POINTER A parameter contained an invalid pointer.
E_INK_EXCEPTION An 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". Therefore, removing "hello" will also implicity remove "Hello" and "HELLO". However, if you add "hello" and then remove "Hello", the RemoveWord call will have no effect, since "Hello" was never explicity added.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example shows an example of removing all of the words from an array of strings, theUserDictionary, from the InkRecognizerContext.WordList.

'...
Dim theRecognizerContext As InkRecognizerContext
Dim theUserDictionary() As String
'...
'Initialize the theRecognizerContext and theUserDictionary objects here.
'...
Dim theString As String
For Each theString In theUserDictionary
    theRecognizerContext.WordList.RemoveWord theString
Next
'...

Applies To