2011-11-09 4 views
0

グッドモーニングにLinkLabelからWindowsエクスプローラを開くことが可能私はExcelのアドインとして配布されるプロジェクトを持っている、すべての

です、それはC#で書かれており、ExcelDNAを使用します。

私がしたいのは、アドインのメインフォームにリンクラベルを追加することです。クリックすると、特定のインデックスでWindowsエクスプローラを開くことができます。 G:ドライブ。

これは可能ですか?私はいくつかの例を見てきましたが、それらを論じることができませんでした。

ありがとうございました!

答えて

1

絶対に:Microsoft KBから

Option   Function 
    ---------------------------------------------------------------------- 
    /n    Opens a new single-pane window for the default 
        selection. This is usually the root of the drive that 
        Windows is installed on. If the window is already 
        open, a duplicate opens. 

    /e    Opens Windows Explorer in its default view. 

    /root,<object> Opens a window view of the specified object. 

    /select,<object> Opens a window view with the specified folder, file, 
        or program selected. 

    Examples 
    ----------------------------------------------------------------------- 
    Example 1: Explorer /select,C:\TestDir\TestProg.exe 
       Opens a window view with TestProg selected. 

    Example 2: Explorer /e,/root,C:\TestDir\TestProg.exe 
       Opens Explorer with drive C expanded and TestProg selected. 

    Example 3: Explorer /root,\\TestSvr\TestShare 
       Opens a window view of the specified share. 

    Example 4: Explorer /root,\\TestSvr\TestShare,select,TestProg.exe 
       Opens a window view of the specified share with TestProg selected. 

だからあなたは、選択し、そのファイル/ディレクトリでエクスプローラを開くためにExplorer /select,G:\yourfileを呼び出すことができます。感謝:)

+0

出来上がりProcess.Start()らに呼び出す

入れは、これを見落として!当時のひとつ... –

関連する問題