在VC6中使用MSDN8

将如下面宏添加到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 
= RTrimLTrim( 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

 


posted on 2008-03-27 08:49 FongLuo 阅读(406) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2008年3月>
2425262728291
2345678
9101112131415
16171819202122
23242526272829
303112345

导航

常用链接

留言簿

随笔分类(11)

随笔档案(79)

文章档案(1)

收藏夹(38)

学习网站

一般网站

最新随笔

搜索

积分与排名

最新评论

阅读排行榜