D
DotNetUser
I got the error message:
An unhandled exception of type 'System.InvalidCastException' occurred in
sparser.exe
Additional information: QueryInterface for interface Word._Application
failed.
Anyone can figure out why?
Thanks:
==========================
OS: Windows XP Professional Version 2002, Service Pack 1
Word: Microsoft Word 2000(9.0.6926 SP-3)
if( openFileDialog.ShowDialog() == DialogResult.OK )
{
object fileName = openFileDialog.FileName;
object saveFile = fileName + "_Vk.doc";
object vk_read_only = false;
object vk_visible = true;
object vk_false = false;
object vk_true = true;
object vk_dynamic = 2;
object vk_missing = System.Reflection.Missing.Value;
// Let make the word application visible
vk_word_app.Visible = true;
vk_word_app.Activate();
// Let's open the document
Word.Document vk_my_doc = vk_word_app.Documents.Open( ref fileName,
ref vk_missing, ref vk_read_only, ref vk_missing, ref vk_missing,
ref vk_missing, ref vk_missing, ref vk_missing, ref
vk_missing,
ref vk_missing, ref vk_missing, ref vk_visible );
An unhandled exception of type 'System.InvalidCastException' occurred in
sparser.exe
Additional information: QueryInterface for interface Word._Application
failed.
Anyone can figure out why?
Thanks:
==========================
OS: Windows XP Professional Version 2002, Service Pack 1
Word: Microsoft Word 2000(9.0.6926 SP-3)
if( openFileDialog.ShowDialog() == DialogResult.OK )
{
object fileName = openFileDialog.FileName;
object saveFile = fileName + "_Vk.doc";
object vk_read_only = false;
object vk_visible = true;
object vk_false = false;
object vk_true = true;
object vk_dynamic = 2;
object vk_missing = System.Reflection.Missing.Value;
// Let make the word application visible
vk_word_app.Visible = true;
vk_word_app.Activate();
// Let's open the document
Word.Document vk_my_doc = vk_word_app.Documents.Open( ref fileName,
ref vk_missing, ref vk_read_only, ref vk_missing, ref vk_missing,
ref vk_missing, ref vk_missing, ref vk_missing, ref
vk_missing,
ref vk_missing, ref vk_missing, ref vk_visible );