將如下面宏添加到VC6中;并給它分配快捷鍵F1即可。
Tools->Macro->Edit,輸入宏名,按OK。
使用VC7時,將 HelpApp.SetCollection "ms-help://MS.MSDNQTR.v80.chs", "Visual C++ and Related"
換成 HelpApp.SetCollection "ms-help://MS.VSCC", "Visual C++ and Related" 即可。
如果使用MSDN9,則要自己截取MSDN9的快捷方式中的關(guān)鍵字(我沒有安裝MSDN9,不知道是什么樣的關(guān)鍵字)。
這段宏代碼是從國外的網(wǎng)站抄過來的,原地址已經(jīng)不記得了。
'------------------------------------------------------------------------------
'FILE DESCRIPTION: New Macro File
'------------------------------------------------------------------------------
'--------------------------------------------------------------
'Global variable for MSDN.NET window.
dim HelpApp
Sub RunMSDNdotNET()
'DESCRIPTION: Call external MSDN .NET Help!
' (C) 2002 Igor Solovyov (siv@bravoport.com.ua)
' v.1.2
Dim sel
Dim LineNum
Dim ColNum
'PrintToOutputWindow VarType(ActiveDocument)
If VarType(ActiveDocument) = vbObject Then '9
Exit Sub
End If
sel = ActiveDocument.Selection.Text
if ActiveDocument.Selection = "" Then
LineNum = ActiveDocument.Selection.CurrentLine
ColNum = ActiveDocument.Selection.CurrentColumn
ActiveDocument.Selection.WordRight dsMove
ActiveDocument.Selection.WordLeft dsExtend
sel = ActiveDocument.Selection.Text
ActiveDocument.Selection.MoveTo LineNum, ColNum
End If
sel = RTrim( LTrim( sel ) )
'---------------------------
'ProgID = DExplore.AppObj
'TypeLib = {83285928-227C-11d3-B870-00C04F79F802}
' C:\Program Files\Common Files\Microsoft Shared\MSEnv\vshelp.tlb
'
'ms-help://MS.VSCC
'---------------------------
if IsEmpty(HelpApp) Then
Set HelpApp = CreateObject("DExplore.AppObj")
End If
'Set the January 2002 Collection and "Visual C++ and Related" filter
'HelpApp.SetCollection "ms-help://MS.VSCC", "Visual C++ and Related"
HelpApp.SetCollection "ms-help://MS.MSDNQTR.v80.chs", "Visual C++ and Related" ' /LaunchNamedUrlTopic DefaultPage"
'"" - Collection w\o filtering. You can create your personal filter and insert it name here.
'HelpApp.SetCollection "ms-help://MS.VSCC", ""
'HelpApp.ConTents()
HelpApp.Index()
On Error Resume Next
'Trying to invoke context help on sel
HelpApp.DisplayTopicFromKeyword( sel )
HelpApp.DisplayTopicFromF1Keyword( sel )
Dim wsh
Set wsh = CreateObject("WScript.Shell")
'If your MSDN help window have different title you have to pick it here!
wsh.AppActivate( "Visual Studio .NET Combined Collection" )
End Sub