2015-06-08 18 views
0

我只想通過單擊按鈕或超鏈接打開它。它不想在我的程序中打開它我有一個字符串有一個文檔的引用(例如c: users testdocument.doc)

+2

克里斯 - 嗨。看看SO幫助主題[我如何提出一個好問題?](http://stackoverflow.com/help/how-to-ask) –

+0

[使用WPF中的超鏈接示例]的可能重複(http:///stackoverflow.com/questions/10238694/example-using-hyperlink-in-wpf?rq=1)。請參閱接受的答案。 – sthotakura

+0

我會做到這一點,對不起 – chris

回答

0

如果您不想在應用程序中打開它,這意味着您將使用Office應用程序打開它。 因爲你沒有提到你使用的編程語言(我猜測,從WPF標籤,一些Visual Studio的語言)作爲https://msdn.microsoft.com/en-us/library/tcyt0y1f.aspx狀態

爲C#

this.Application.Documents.Open(@"c:\users\testdocument.doc"); 

和VB

Me.Application.Documents.Open("c:\users\testdocument.doc") 

並將其打開爲只讀

C#

this.Application.Documents.Open(@"c:\users\testdocument.doc", ReadOnly:true); 

VB

Me.Application.Documents.Open(FileName:="c:\users\testdocument.doc", ReadOnly:=True) 
+0

這是它謝謝你 – chris

相關問題