查看单个帖子
旧 2009-04-21, 05:22 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 用webbrower操纵excel时,为什么控件没有navigatecomplete2方法?

用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() );
}
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)