Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2007

Tip: Looking for answers? Try searching our database.

COMException (0x800A1066): Command failed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marvin Massih - 07 Dec 2005 15:05 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.