「含んでいるフォルダを開く」の版間の差分

提供: MeryWiki
ナビゲーションに移動 検索に移動
MSY-07 (トーク | 投稿記録)
句読点の修正
MSY-07 (トーク | 投稿記録)
コード: ソースコードの整形
17行目: 17行目:
var doc = window.Editor.ActiveDocument;
var doc = window.Editor.ActiveDocument;
if (doc.Path) {
if (doc.Path) {
  var shell = new ActiveXObject("WScript.Shell");
var shell = new ActiveXObject("WScript.Shell");
  shell.Run("rundll32.exe url.dll FileProtocolHandler \"" + doc.Path + "\"");
shell.Run("rundll32.exe url.dll FileProtocolHandler \"" + doc.Path + "\"");
}
}
</syntaxhighlight>
</syntaxhighlight>

2023年7月15日 (土) 11:31時点における版

概要

開いているドキュメントがあるフォルダをエクスプローラで表示します。

VisualStudio の「含んでいるフォルダを開く」機能の模倣です。

コード

#title = "含んでいるフォルダを開く"

// -----------------------------------------------------------------------------
// 開いているドキュメントのフォルダを開きます。
//
// Copyright (c) ks. All Rights Reserved.
// www:    http://merysmacro.seesaa.net/
// -----------------------------------------------------------------------------

var doc = window.Editor.ActiveDocument;
if (doc.Path) {
	var shell = new ActiveXObject("WScript.Shell");
	shell.Run("rundll32.exe url.dll FileProtocolHandler \"" + doc.Path + "\"");
}
スポンサーリンク