Answered by:
Add item to Help menu

Question
-
Answers
-
This is quite simple. First you will create a macro that does it and then you'll place it in Help menu.
- Create the following macro:
Code SnippetSub OpenUrlInNewTab()
Try
Dim url As String
url = "ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_vscmds/html/c6a4fbd6-8e9d-45cc-8b2f-93990d065e78.htm"
'enclose URL in double quotes
url = """" & url & """"
DTE.ExecuteCommand("nav", url & " /new")
'nav is alias for View.ShowWebBrowser command
'Syntax:
'View.ShowWebBrowser URL [/new][/ext]
'
'/new
' Optional. Specifies that the page appears in a new instance of the Web browser.
'/ext
' Optional. Specifies that the page appears in the default Web browser outside of the IDE.
Catch ex As Exception
End Try
End Sub
Change the url variable to your desired value. Here is a quick help how to create macro in VS. - Place this macro to your Help menu. Here's the help how to do it.
- Create the following macro:
-
Ah, that's a different story. Macros cannot be deployed. If you want to do all this on other machines, you need to create add-in. This is more complicated. Just create Add-in project in VS. It will create simple add-in which adds its own menu under Tools menu. You need to modify the code so that it creates menu under Help. Then you add the code from the macro to the menu handler.
See http://mztools.com/resources_vsnet_addins.aspx for great information about VS add-ins. Specially, see the following articles:
HOWTO: Adding buttons, commandbars and toolbars to Visual Studio .NET from an add-in
HOWTO: Guessing the name of a command bar to add a custom menu entry in Visual Studio .NET add-ins
HOWTO: Removing commands and UI elements during Visual Studio .NET add-in uninstallation
All replies
-
This is quite simple. First you will create a macro that does it and then you'll place it in Help menu.
- Create the following macro:
Code SnippetSub OpenUrlInNewTab()
Try
Dim url As String
url = "ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_vscmds/html/c6a4fbd6-8e9d-45cc-8b2f-93990d065e78.htm"
'enclose URL in double quotes
url = """" & url & """"
DTE.ExecuteCommand("nav", url & " /new")
'nav is alias for View.ShowWebBrowser command
'Syntax:
'View.ShowWebBrowser URL [/new][/ext]
'
'/new
' Optional. Specifies that the page appears in a new instance of the Web browser.
'/ext
' Optional. Specifies that the page appears in the default Web browser outside of the IDE.
Catch ex As Exception
End Try
End Sub
Change the url variable to your desired value. Here is a quick help how to create macro in VS. - Place this macro to your Help menu. Here's the help how to do it.
- Create the following macro:
-
-
Ah, that's a different story. Macros cannot be deployed. If you want to do all this on other machines, you need to create add-in. This is more complicated. Just create Add-in project in VS. It will create simple add-in which adds its own menu under Tools menu. You need to modify the code so that it creates menu under Help. Then you add the code from the macro to the menu handler.
See http://mztools.com/resources_vsnet_addins.aspx for great information about VS add-ins. Specially, see the following articles:
HOWTO: Adding buttons, commandbars and toolbars to Visual Studio .NET from an add-in
HOWTO: Guessing the name of a command bar to add a custom menu entry in Visual Studio .NET add-ins
HOWTO: Removing commands and UI elements during Visual Studio .NET add-in uninstallation