Export (0) Print
Expand All

ISmartTagAction2 Interface [Office 2003 SDK Documentation]

Office 2003

The ISmartTagAction and ISmartTagAction2 interfaces implement the properties and methods required by DLLs to support verbs applicable to a specific recognizer.

The new ISmartTagAction2 interface introduced in Microsoft® Office 2003 provides three additional properties and two methods that developers can implement when developing smart tag DLLs. If you want to use the new functionality provided by the ISmartTagAction2 interface in Office 2003, you need to implement the ISmartTagAction2 interface, in addition to the ISmartTagAction interface provided in Office XP.

To implement an action handler in Office 2003, you must implement ISmartTagAction. It is not necessary to implement the ISmartTagAction2 interface in Office 2003 if you do not want to. However, you will not be able to leverage the new functionality provided by the ISmartTagAction2.

The ISmartTagAction2 supplies three read-only properties. Two methods are also provided.

Member Summary

Properties

Name Type Description
ShowSmartTagIndicator Boolean Indicates whether the smart tag indicator should be shown
IsCaptionDynamic Boolean Determines whether a particular caption is dynamic
VerbCaptionFromID String A caption for a smart tag type action for display in the Smart Tag Actions menu

Methods

Name Description
SmartTagInitialize Initializes objects.
InvokeVerb2 Invokes a verb.

Remarks

Writing a smart tag action is somewhat similar to writing a smart tag recognizer; there are a number of properties that are used when an implementing application is interrogating the action, and there is one method (InvokeVerb2 method if implementing ISmartTagAction2) where most of the significant work is done. The following interface description language defines the ISmartTagAction2 interface.

interface ISmartTagAction2 : IDispatch
    {
        [propget, id(12)]
        HRESULT VerbCaptionFromID2([in] int VerbID, 
                                   [in] BSTR ApplicationName, 
                                   [in] int LocaleID, 
                                   [in] ISmartTagProperties *Properties, 
                                   [in] BSTR Text, 
                                   [in] BSTR XML,
                                   [in] IDispatch *Target,
                                   [out, retval] BSTR *Caption);

        [id(13)]
        HRESULT InvokeVerb2([in] int VerbID,
                               [in] BSTR ApplicationName,
                               [in] IDispatch *Target,
                               [in] ISmartTagProperties *Properties, 
                               [in] BSTR Text,
                               [in] BSTR Xml,
                               [in] int LocaleID);    

        [propget, id(14)]
        HRESULT IsCaptionDynamic([in] int VerbID, 
                                 [in] BSTR ApplicationName, 
                                 [in] int LocaleID, 
                                 [out, retval] VARIANT_BOOL *Dynamic);                   

        [propget, id(15)]
        HRESULT ShowSmartTagIndicator([in] int VerbID, 
                                      [in] BSTR ApplicationName, 
                                      [in] int LocaleID, 
                                      [out, retval] VARIANT_BOOL *Visible);

        [id(16)]
        HRESULT SmartTagInitialize([in] BSTR ApplicationName);        
    }


Show:
© 2014 Microsoft