D
Dmitry Nogin
Hi,
The following code works well for MS Excell but fails on MS Word...
Can you suggest anything? (.NET 2.0)
Type wordType = Type.GetTypeFromProgID("Word.Application");
object wordApplication = Activator.CreateInstance(wordType);
object margins = wordType.InvokeMember("InchesToPoints", BindingFlags.InvokeMethod,
null, wordApplication, new object[] { (double)1 });
The last line fails with E_FAIL on WinWord2003, WinWord2007
What is interesing? You can replace ProgID to Excel.Application - it works. You can replace InchesToPoints to PixelsToPoints - it does work. What's wrong about it?!
Thanks.
-- dmitry
The following code works well for MS Excell but fails on MS Word...
Can you suggest anything? (.NET 2.0)
Type wordType = Type.GetTypeFromProgID("Word.Application");
object wordApplication = Activator.CreateInstance(wordType);
object margins = wordType.InvokeMember("InchesToPoints", BindingFlags.InvokeMethod,
null, wordApplication, new object[] { (double)1 });
The last line fails with E_FAIL on WinWord2003, WinWord2007
What is interesing? You can replace ProgID to Excel.Application - it works. You can replace InchesToPoints to PixelsToPoints - it does work. What's wrong about it?!
Thanks.
-- dmitry