我有一个引用文档的字符串(例如 c:\users\testdocument.doc)
I have a string that has a reference to a document (example c:\users\testdocument.doc)
我只想通过单击按钮或超链接来打开它。它不想在我的程序中打开它
如果您不想在您的应用程序中打开它,这意味着您将使用 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)
我只想通过单击按钮或超链接来打开它。它不想在我的程序中打开它
如果您不想在您的应用程序中打开它,这意味着您将使用 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)