Hi,
I have written a .NET 1.1 program to automate Word using COM interop and
late binding.
On my development system (Word 2003) everything runs smoothly.
However, on a different computer (Word 2000) the following code throws a
COMException:
------ SNIP ------
string htmlFile = /* path to some .HTM file */;
object filteredHtml = 10; //WdSaveFormat.wdFormatFilteredHTML
parameters = new object[] { htmlFile, filteredHtml };
doc.GetType().InvokeMember("SaveAs", BindingFlags.InvokeMethod |
BindingFlags.OptionalParamBinding, null, doc, parameters);
------ SNAP ------
"doc" has been successfully loaded using Application.Documents.Load() in
advance.
The thrown exception is:
"COMException (0x800A1066): Command failed"
Google gave me lots of hits, but unfortunately no solution to this
problem :-/.
Any help would be highly appreciated.
Regards,
Marvin
P.S.:
X-Post, F'up2 set.
Cindy M -WordMVP- - 09 Dec 2005 14:13 GMT
Hi Marvin,
> I have written a .NET 1.1 program to automate Word using COM interop and
> late binding.
>
> On my development system (Word 2003) everything runs smoothly.
> However, on a different computer (Word 2000) the following code throws a
[quoted text clipped - 12 lines]
>
> ------ SNAP ------
Have you checked that wdFormatFilteredHTML is valid in Word 2000? I'm
thinking that may have been introduced in Word 2002...
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Marvin Massih - 09 Dec 2005 14:16 GMT
> Have you checked that wdFormatFilteredHTML is valid in Word 2000? I'm
> thinking that may have been introduced in Word 2002...
Yes, I think that may be the problem.
I just finished a new version which makes use of the external HTML
filter and await test results...
Marvin
(x-post & f'up2 microsoft.public.word.oleinterop)
akshar108 - 17 Sep 2007 05:07 GMT
Hello Marvin how r u I am also facing this kind of problem about word
counting of doc file my web server is 2003 and i m using 2000 server
application is running nice in my pc but not on web server if u get any
solution then please tell me
>Hi,
>
[quoted text clipped - 35 lines]
>P.S.:
>X-Post, F'up2 set.