R
Richard T. Edwards
Suggestion:
To see if its the interop issue, start a new project and add only the
reference to the Runtime.InteropServices:
using System.Runtime.InteropServices
Then in your event:
private void button2_Click(object sender, System.EventArgs e)
{
Object[] myargs = new Object[1];
myargs[0] = true;
System.Type TWord = System.Type.GetTypeFromProgID("Word.Application.9");
System.Object WordAp = System.Activator.CreateInstance(TWord);
WordAp.GetType().InvokeMember("Visible",
System.Reflection.BindingFlags.SetProperty, null, WordAp, myargs);
}
This should create an instnace of word and set the visible property to true.
If this works -- as it does on my machine -- then there's a very good chance
you have a Microsoft.Office.Interop issue. Also, try referencing only the
Microsoft Word 11.0 Object Library, too.
hth.
To see if its the interop issue, start a new project and add only the
reference to the Runtime.InteropServices:
using System.Runtime.InteropServices
Then in your event:
private void button2_Click(object sender, System.EventArgs e)
{
Object[] myargs = new Object[1];
myargs[0] = true;
System.Type TWord = System.Type.GetTypeFromProgID("Word.Application.9");
System.Object WordAp = System.Activator.CreateInstance(TWord);
WordAp.GetType().InvokeMember("Visible",
System.Reflection.BindingFlags.SetProperty, null, WordAp, myargs);
}
This should create an instnace of word and set the visible property to true.
If this works -- as it does on my machine -- then there's a very good chance
you have a Microsoft.Office.Interop issue. Also, try referencing only the
Microsoft Word 11.0 Object Library, too.
hth.