Help2.SearchEx Method

Selects the Search window and optionally fills the Search dialog box with a term or executes a search for a specific term.

Namespace:  Microsoft.VisualStudio.VSHelp80
Assembly:  Microsoft.VisualStudio.VSHelp80 (in Microsoft.VisualStudio.VSHelp80.dll)

Syntax

'宣言
Sub SearchEx ( _
    bstrSearchFilterTransform As String, _
    pszSearchTerm As String, _
    vssfSearchFlags As UInteger _
)
'使用
Dim instance As Help2
Dim bstrSearchFilterTransform As String
Dim pszSearchTerm As String
Dim vssfSearchFlags As UInteger

instance.SearchEx(bstrSearchFilterTransform, _
    pszSearchTerm, vssfSearchFlags)
void SearchEx(
    string bstrSearchFilterTransform,
    string pszSearchTerm,
    uint vssfSearchFlags
)
void SearchEx(
    [InAttribute] String^ bstrSearchFilterTransform, 
    [InAttribute] String^ pszSearchTerm, 
    [InAttribute] unsigned int vssfSearchFlags
)
function SearchEx(
    bstrSearchFilterTransform : String, 
    pszSearchTerm : String, 
    vssfSearchFlags : uint
)

Parameters

  • bstrSearchFilterTransform
    Type: System.String

    Not used. Pass in a null reference (Nothing in Visual Basic).

  • pszSearchTerm
    Type: System.String

    A string containing the search term.

Examples

Create a Visual Studio add-in by using Visual C# as described in How to: Create an Add-In. Add references to Microsoft.VisualStudio.VSHelp, Microsoft.VisualStudio.VSHelp80, and System.Windows.Forms. Replace the code in the OnConnection method in the Connect.cs file with the following code. Run the code example as described in How to: Compile and Run the Automation Object Model Code Examples.

using System;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.VSHelp;
using Microsoft.VisualStudio.VSHelp80;
using System.Windows.Forms;

public void OnConnection(object application,
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    HelpSearchExexample(_applicationObject);
}

public void HelpSearchExexample(DTE2 dte)
{
    // This add-in searches for Help topics on automation.
    try
    {
        Microsoft.VisualStudio.VSHelp80.Help2 help2 =
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject("Help2");

        // Start a search on the keyword, automation.
        help2.SearchEx(null, "automation", 1);
    }

    catch (SystemException ex)
    {
        MessageBox.Show("ERROR: " + ex);
    }
}

Permissions

See Also

Reference

Help2 Interface

Help2 Members

Microsoft.VisualStudio.VSHelp80 Namespace