将如下面宏添加到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的快捷方式中的关键字(我没有安装MSDN9,不知道是什么样的关键字)。
这段宏代码是从国外的网站抄过来的,原地址已经不记得了。
'------------------------------------------------------------------------------
'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