[ FrontPage | リロード ] [ 新規 | 一覧 | 検索 | ヘルプ | 更新履歴 ]
[ 編集 | 差分 | ソース ]

サクラエディタ > マクロ > MSDNで検索 - 選択範囲をMSDNで検索

目次

選択範囲をMSDNで検索

[編集]

dexplore.vbs
 1 | ' 選択位置、カーソル位置の単語をMSDNのdexploreから検索
 2 | 
 3 | ' 環境に合わせて下記記を修正
 4 | '  [スタート] -> [プログラム] -> [MSDN xx] ->[xxドキュメント] のプロパティを参照
 5 | '  リンク先のexe名を                   helpexe に設定
 6 | '  リンク先の ms-help:// で始まるURIを helpuri に設定
 7 | Dim helpexe, helpuri
 8 | 
 9 | helpexe = "C:Program FilesCommon FilesMicrosoft SharedHelpdexplore.exe"
10 | helpuri = "ms-help://ms.vscc.2003/"
11 | 
12 | 
13 | Dim keyword
14 | keyword = Editor.GetSelectedString(0)
15 | If keyword = "" Then
16 |     Editor.SelectWord
17 |     keyword = Editor.GetSelectedString(0)
18 | End If
19 | If keyword <> "" Then
20 | 
21 | On Error Resume Next
22 |     Dim help
23 |     Set help = GetObject(, "DExplore.AppObj")
24 | 
25 |     If Err.Number <> 0 Then
26 | On Error Goto 0
27 |         Dim sh, e
28 |         Set sh = CreateObject("WScript.Shell")
29 |         Set e  = sh.Exec(helpexe)
30 | 
31 |         Do Until sh.AppActivate(e.ProcessID)
32 |             'WScript.Sleep 100 ' Sleepが使えない
33 |         Loop
34 | 
35 | On Error Resume Next
36 |         Dim i
37 |         For i = 0 To 100
38 |             Set help = GetObject(, "DExplore.AppObj")
39 |             If Err.Number = 0 Then Exit For
40 |         Next
41 | On Error Goto 0
42 |     End If
43 | 
44 |     help.SetCollection helpuri, "" 'none-filter
45 |     help.Contents
46 |     help.DisplayTopicFromF1Keyword keyword
47 |     help.SyncIndex keyword, 1
48 |     help.IndexResults
49 | 
50 | End If
<< 2007-04-22 (Sun) 20:54:06 2007-04-22 (Sun) 20:56:36

Valid XHTML 1.1
Creative Commons License This work is licensed under a Creative Commons License