开发者

Opening office documents in WebBrowser control without file download dialog?

开发者 https://www.devze.com 2023-03-06 22:32 出处:网络
I am using the WebBrowser control in my WPF application to embed the opening of Office documents. When opening a document: webBrowser.Navigate(\"example.docx\"); a file download dialog appears.

I am using the WebBrowser control in my WPF application to embed the opening of Office documents.

When opening a document: webBrowser.Navigate("example.docx"); a file download dialog appears.

I would like the file to just open without prompting the user to open or save. You can do this by changing the Confirm open after download checkbox in file types tab of folder options (http://support.microsoft.com/kb/303475). But I would like to be able to开发者_开发百科 do this automatically within my program.

Is there some registry flag I can set to do this or any other way to achieve what I need?


I guess you can try to modify the reg key as written here


If you are getting this message then looks like you lost your file association. What you can do is:

  1. In Windows Explorer Right Mouse click on the file you trying to open
  2. In the Context Menu click on "Open With" and then depending on your file click on either Program that you would like this file type to be associated or click on "Choose default program"
  3. Click on Program you want your file to be open with
  4. Make sure you select "Always use the selected program to open this kind of file" check box, and click on Okay button.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号