all groups > dotnet interop > august 2005 >
You're in the

dotnet interop

group:

"Command Failed" error - Word interop


"Command Failed" error - Word interop Laura Villa
8/29/2005 7:12:03 AM
dotnet interop:
Hello everyone,
I'm trying to do some office automation via interop
in an asp.net application. An generic "Command Failed" error occurred while
opening the document:

Word.ApplicationClass oWordApp = new Word.ApplicationClass();

object fileName = strFileName;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;


Word.Document oWordDoc = oWordApp.Documents.Open(ref fileName,
ref missing,ref readOnly,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref isVisible,
ref missing,ref missing,ref missing, ref missing); '<<-- error here

The path to the file (strFileName) is correct, the file exists.
I tried to low the security settings for Macros in Word but it didn't work.
Also tried:

oWordApp.AutomationSecurity = msoAutomationSecurityForceDisable;

to set security programmatically. The result was the same.

Any hint?
Thanks a lot,

Re: "Command Failed" error - Word interop tomw
12/16/2005 4:22:29 PM

Hi Laura,

Did you ever solve this? I've been trying for hours now and I'm losin
hair over it!

Any help would be so very gratefully received.

Thanks in advance,

To

--
tom
-----------------------------------------------------------------------
tomw's Profile: http://www.hightechtalks.com/m53
View this thread: http://www.hightechtalks.com/t222509
AddThis Social Bookmark Button