CommitSmartTag Method [Office 2003 SDK Documentation]

Tells the ISmartTagRecognizerSite interface to add a new smart tag based on the passed-in text.

Applies To

ISmartTagRecognizerSite

Syntax

VOID CommitSmartTag (STRING SmartTagName, INT Start, INT Length, ISmartTagProperties Properties)

SmartTagName**  A smart tag type string, which is in the form of namespaceURI#tagname.

Start**  An integer (1-based) which specifies the start position of the recognized smart tag in a recognized text.

Length**  A count of the number of characters the smart tag will span. For example, if you are recognizing "Microsoft Excel" in a document, Length will equal 15.

Properties  An ISmartTagProperties collection. A recognizer can pass in Null, or supply an ISmartTagProperties object that it previously obtained with the NewPropertyBag call.

Remarks

The CommitSmartTag method is at the heart of smart tag recognition. This is where the recognizer annotates the text range passed to the Recognize method with a smart tag type. If the string you want recognized is rather long, it is good practice to have error code to check and trap for cases where commiting the smart tag failed because the smart tag was too long.