用webbrower操纵excel时,为什么控件没有navigatecomplete2方法?
www.dimcax.com
用webbrower操纵excel时,为什么控件没有navigatecomplete2方法?
好像大部分介绍webbrowser操纵excel时用的都是这个方法,但是其控件中并没有这个方法,为什么,该怎么做,用webbrowser1_navigated()方法可行吗,怎么获得excel进程?请高人指教?
public void axwebbrowser1_navigatecomplete2(object sender, axshdocvw.dwebbrowserevents2_navigatecomplete2event e)
{
//note: you can use the reference to the document object to
// automate the document server.
object o = e.pdisp;
odocument = o.gettype().invokemember("document",bindingflags.getproperty,null,o,null);
object oapplication = o.gettype().invokemember("application",bindingflags.getproperty,null,odocument,null);
object oname = o.gettype().invokemember("name",bindingflags.getproperty ,null,oapplication,null);
messagebox.show("file opened by: " + oname.tostring() );
}