| Hi, I need to open word document inside the webbrowser. its is acheived when i open word2003,but not word2007.i got some links saying ActiveXwebbrowser will solve this problem. i tried that also but its opening as a newwindow explorer not inside the ActiveXwebbrowser. am working in windows application using c#.net. OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); openFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"; if (openFileDialog.ShowDialog(this) == DialogResult.OK) { object null_obj_str = ""; string FileName = openFileDialog.FileName; object loc = FileName; System.Object null_obj = 0; axWebBrowser1.Navigate2(ref loc, ref null_obj, ref null_obj, ref null_obj_str, ref null_obj_str); //axWebBrowser1.Navigate(new Uri(FileName)); } |
Loading

Vikrant Jadhav64 reputationPosted Dec 21, 2011, 1:22 AM EST
try following code
Regards
Vikrant Jadhav
If this post Helpful to you the mark as a "Correct Answer".
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Dec 21, 2011, 1:43 AM EST
Add foll reference in ur project:
AxInterop.SHDocVw
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Dec 21, 2011, 1:46 AM EST
Deva Subbu31 reputationPosted Dec 21, 2011, 2:13 AM EST
Thanks for ur reply, i have tried your code. but the word opening in new explorer not inside the webbrowser.
Thanks.
Dev.
Deva Subbu31 reputationPosted Dec 21, 2011, 2:15 AM EST
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Dec 21, 2011, 2:33 AM EST
Try this
Deva Subbu31 reputationPosted Dec 21, 2011, 2:54 AM EST
Thanks for your Demo App.
Demo application is working fine for word2003 doc. my problem is when i try to open word2007 it opening in the separate browser not inside that activeWebbrowser.
Thanks,
Dev.
Pravin GhadgeRank #1,340 · 1.3K reputationPosted Dec 21, 2011, 7:55 AM EST
Webbrowser doesnot support for office 2007.
U have to add 1 registry.
Plz download it & just double click on it to execute it.
Then it will dfinately work for u.
Plz reply if not work properly.
zia uddin37 reputationPosted Apr 16, 2014, 1:59 AM EDT
dipak rathi2 reputationPosted Oct 4, 2014, 10:12 PM EDT
Every thing is working fine but i want all documnets that are opening in web page as non editable ,currently i am able to edit office documnets in web page.
Ravindra Chigurupati9 reputationPosted Dec 1, 2014, 1:31 AM EST
I was looking for this from past 2 weeks, finally i was able to open the documents in webbrowser control. Thanks :).. SO here we need to register the registery keys.. can i know what is the relation between the registrey keys and webBrowser control ?. Do we face any issues while open word as normal (with out webbrowser) because of registry keys ??
Thanks,
Ravindra.