开发者论坛

 找回密码
 注册 (请使用非IE浏览器)
查看: 3381|回复: 0

[求助] word 在C#中的打开问题

[复制链接]

0

精华

0

贡献

0

赞扬

帖子
9
软币
112
在线时间
4 小时
注册时间
2014-5-27
发表于 2014-5-28 16:50:58 | 显示全部楼层 |阅读模式
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))

求指教!!!



回复

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2024-5-3 13:24

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表