打开文件 [英] Opening a document

查看:94
本文介绍了打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




如何让vb.net在各自的应用程序中打开文档;单词,excel

等来自文档名称和路径?例如c:\ ... \ mydoc.doc应该

自动打开。


谢谢


问候

Hi

How can I make vb.net open a document in its respective app; word, excel
etc. from a documents name and path? e.g. c:\...\mydoc.doc should
automatically open in word.

Thanks

Regards

推荐答案

*" John" <乔** @ nospam.infovis.co.uk> scripsit:
* "John" <jo**@nospam.infovis.co.uk> scripsit:
如何让vb.net在各自的应用程序中打开文档; word,excel
等来自文档名称和路径?例如c:\ ... \ mydoc.doc应该自动打开。
How can I make vb.net open a document in its respective app; word, excel
etc. from a documents name and path? e.g. c:\...\mydoc.doc should
automatically open in word.




\\\

Dim p As New System.Diagnostics.ProcessStartInfo()

p.Verb =" print"

p.WindowStyle = ProcessWindowStyle.Hidden

p.FileName =" C:\ filename.doc"

p.UseShellExecute = True

System.Diagnostics.Process.Start(p)

///


-

Herfried K. Wagner [MVP]

< http:/ /www.mvps.org/dotnet>



\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.doc"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


*" John" <乔** @ nospam.infovis.co.uk> scripsit:
* "John" <jo**@nospam.infovis.co.uk> scripsit:
如何让vb.net在各自的应用程序中打开文档; word,excel
等来自文档名称和路径?例如c:\ ... \ mydoc.doc应该自动打开。
How can I make vb.net open a document in its respective app; word, excel
etc. from a documents name and path? e.g. c:\...\mydoc.doc should
automatically open in word.




\\\

Dim p As New System.Diagnostics.ProcessStartInfo()

p.Verb =" print"

p.WindowStyle = ProcessWindowStyle.Hidden

p.FileName =" C:\ filename.doc"

p.UseShellExecute = True

System.Diagnostics.Process.Start(p)

///


-

Herfried K. Wagner [MVP]

< http:/ /www.mvps.org/dotnet>



\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.doc"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


谢谢。之后我是否需要进行任何清理,比如关闭流程

等?


问候


Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道

news:O9 ************** @ TK2MSFTNGP10.phx.gbl ...
Thanks. Do I need to do any cleanup afterwards too, like close the process
etc.?

Regards

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
*" John" <乔** @ nospam.infovis.co.uk> scripsit:
* "John" <jo**@nospam.infovis.co.uk> scripsit:
如何让vb.net在各自的应用程序中打开文档; word,excel
等来自文档名称和路径?例如c:\ ... \ mydoc.doc应该自动打开。
How can I make vb.net open a document in its respective app; word, excel
etc. from a documents name and path? e.g. c:\...\mydoc.doc should
automatically open in word.



\\\
Dim p As New System。 Diagnostics.ProcessStartInfo()
p.Verb =" print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName =" C:\ filename.doc"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///

-
Herfried K. Wagner [MVP]
< http://www.mvps.org/dotnet>



\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.doc"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>



这篇关于打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆