Tuesday, January 30, 2007

c#.net中关于嵌入文档后"另存为"的问题

发信人: pseudocode (I can Run!), 信区: DotNET
标 题: Re: c#.net中关于嵌入文档后"另存为"的问题
发信站: 水木社区 (Tue Jan 30 14:49:53 2007), 站内

要显示菜单栏可以用下面的方式


object o = this.webBrowser1.ActiveXInstance;
if (o == null)
{
return;
}

IWebBrowser2 browser = o as IWebBrowser2;
if (browser != null)
{
object nullObject = null;
browser.ExecWB(SHDocVw.OLECMDID.OLECMDID_HIDETOOLBARS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, ref nullObject, ref nullObject);
}

如果只是想要saveas的话,也可以在navigatecomplete后
IWebBrowser2 browser = this.webBrowser1.ActiveXInstance as IWebBrowser2;
Excel.WorkBook book = browser.Document as Excel.Workbook;
book.saveas(...)



【 在 sandwyg (ger) 的大作中提到: 】
: c#.net用WebBrowser控件可以实现文档的嵌入,但是无法显示office文档菜单栏,那我想"另存为"怎么实现

2 comments:

rainbow angeles said...

Hi! Thanks for your comment in my blog. Wow... what is? I dun quite understand... programming stuff?

Cloudsun said...

Yes, I am a progammer :)