Click here to Skip to main content
15,885,668 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
[no name] 26-Apr-14 14:33pm    
You would need to tell us exactly what it is that you mean when you say "it does not work".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900