Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to host Word Document in WPF WebBrowser Control?

$
0
0

Hi All,

I am try to host Office Word Document in WPF WebBrowser control. But it cannot open the Document internally. the word document always open external. I don't know how to fix this issue. Could you help me to fix this issue? I download the sample here.

http://blogs.msdn.com/b/wpfsdk/archive/2008/08/18/wpf-webbrowser-control-sample.aspx

Code Snippet,

        private void goNavigateToWordDoc_Click(object sender, RoutedEventArgs e)
        {
            // see http://nerddawg.blogspot.com/2005/12/more-on-resource-loading-in-wpf.html for
            // more information on pack URIs (pack://siteoforigin).
            Uri uri = new Uri(@"pack://siteoforigin:,,,/Test_Word_File.doc", UriKind.Absolute);

            // Load the word doc into the webBrowser. The user can change this document.
            this.webBrowser.Source = uri;

        }

Thanks a lot.

Ricky Yan,


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>