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.