Udostępnij za pośrednictwem


Help2.DisplayTopicFromURL(String) Method

Definition

Displays a Help topic specified by the URL in Document Explorer.

public:
 void DisplayTopicFromURL(System::String ^ pszURL);
public:
 void DisplayTopicFromURL(Platform::String ^ pszURL);
void DisplayTopicFromURL(std::wstring const & pszURL);
[System.Runtime.InteropServices.DispId(7)]
public void DisplayTopicFromURL (string pszURL);
[<System.Runtime.InteropServices.DispId(7)>]
abstract member DisplayTopicFromURL : string -> unit
Public Sub DisplayTopicFromURL (pszURL As String)

Parameters

pszURL
String

String containing an URL address that is compatible with Internet Explorer.

Implements

Attributes

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;  
    HelpDisplayFromURLExample(_applicationObject);  
}  

public void HelpDisplayFromURLExample(DTE2 dte)  
{  
    // This opens Document Explorer and   
    // displays the topic specified  
    // by the URL.  
    try  
    {  
        Microsoft.VisualStudio.VSHelp80.Help2 help2 =  
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject ("Help2");  

        // Display the Visual Studio topic.  
        help2.DisplayTopicFromURL  
("ms-help:  
//MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vstoc/  
html/06ddebea-2c83-4a45-bb48-6264c797ed93.htm");  

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

Remarks

DisplayTopicFromURL opens Document Explorer if it is not open already.

Applies to