word 在C#中的打开问题
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() );
}
运行的时候
Object oApplication = o.GetType().InvokeMember("Application", BindingFlags.GetProperty, null, oDocument, null);
用户代码未处理,未知名称。 (异常来自 HRESULT:0x80020006 (DISP_E_UNKNOWNNAME))
求指教!!!
页:
[1]