当第一次打开时,完全没有问题,我再次点击浏览打开时,就在ppt的第二页卡住了。然后我点击下拉,可以继续进行ppt浏览。。望大神来解答下啊。。。。木有分了。。。
1 private void btnOpenFile_Click(object sender, EventArgs e) 2 { 3 //选择文件 4 if (openFileDlg.ShowDialog() == DialogResult.OK) 5 { 6 //先卸载当前的文档 7 SetObjectNull(); 8 tbxOpenFile.Text = openFileDlg.FileName; 9 object fileName = tbxOpenFile.Text; 10 oDocument = null; 11 //加载文档 12 axWebBrowser1.Navigate2(ref fileName, ref refmissing, ref refmissing, ref refmissing, ref refmissing); 13 } 14 } 15 16 /// <summary> 17 /// 加载完成时触发事件 18 /// </summary> 19 /// <param name="sender"></param> 20 /// <param name="e"></param> 21 public void axWebBrowser1_NavigateComplete2(object sender, AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event e) 22 { 23 Object o = e.pDisp; 24 oDocument = o.GetType().InvokeMember("Document", BindingFlags.GetProperty, null, o, null); 25 oApplication = o.GetType().InvokeMember("Application", BindingFlags.GetProperty, null, oDocument, null); 26 oName = o.GetType().InvokeMember("Name", BindingFlags.GetProperty, null, oApplication, null); 27 }