从菜单栏开始办公室申请 [英] opening office application in winform from menubar

查看:99
本文介绍了从菜单栏开始办公室申请的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的winform应用程序菜单栏打开办公应用程序,我为每个应用程序创建了菜单栏链接。我想点击菜单栏链接,办公室应用程序应该在一个单独的子winform中打开。我写了以下代码:



主菜单项目:

Microsoft MS Word:



在MDIParent中:



Aryan.CallApplication = aa; // word.document

frmCallApplication App = new frmCallApplication();

App.MdiParent = this;

App.WindowState = FormWindowState.Maximized;

App.Show();



这段代码调用了frmCallApplication,我编写了如下代码:



private void frmCallApplication_Load (对象发送者,EventArgs e)

{



if(Aryan.CallApplication ==402000000)

{

if(axOffice.IsInstalled(Word.Document))

{

axOffice.CreateNew(Word.Document) ;

}

其他

{

MessageBox.Show(MSWord未安装,先安装它! );

}

}

}



但它不起作用在form_load事件中。



上面的代码在按钮点击事件中运行良好但标题栏,办公按钮,自定义访问工具栏和单词状态栏都没有显示。 />




我愿意喜欢通过表单加载事件打开这个应用程序,希望通过按钮点击事件解决发生的问题。



怎么解决它,请帮帮我。

I want to open office application from my winform application menu bar where i have created menu bar link for each application.I want to click the menu bar link and the office application should be open in a separate child winform.I wrote the following code:

Main Menu Item:
Microsoft MS Word:

In MDIParent :

Aryan.CallApplication = aa;//word.document
frmCallApplication App = new frmCallApplication();
App.MdiParent = this;
App.WindowState = FormWindowState.Maximized;
App.Show();

this code call the frmCallApplication, where i have written the code as follows:

private void frmCallApplication_Load(object sender, EventArgs e)
{

if (Aryan.CallApplication == "402000000")
{
if (axOffice.IsInstalled("Word.Document"))
{
axOffice.CreateNew("Word.Document");
}
else
{
MessageBox.Show("MSWord Not Installed, Install it First !");
}
}
}

but it does not work in form_load event.

the above code run well in button click event but the titlebar, office button, customize access toolbar and status bar of word are not shown.


I would like to open this application through form load event and wish to resolve the issues as happening with button click event.

how to solve it, please help me.

推荐答案

这篇关于从菜单栏开始办公室申请的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆