Re: Help!! Problem instantiating WORD object using C#.NET
From: Prodip Saha (psaha_at_bear.com)
Date: 05/31/05
- Next message: Dominick Baier [DevelopMentor]: "Re: SAML"
- Previous message: jt: "Re: SAML"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 31 May 2005 10:26:30 -0500
The ASPNET (or impersonated) account needs to have administrative rights in
order for the thread to pass the security test. This is also a problem when
you try to instantiate excel object.
The easiestsolution would be- put your code(aspx file) in a separate folder
and add a web.config file there with appropriate credentials.
Thanks,
Prodip
www.aspnet4you.com
"Handy Mulia" <HandyMulia@discussions.microsoft.com> wrote in message
news:2CFC3153-5C41-48E6-9208-3B75AF95D05D@microsoft.com...
> Hi experts,
>
> I am trying to open the content of a WORD file from C#.NET which resides
in
> the REMOTE SERVER, however I get an error:
> "System.Runtime.InteropServices.COMException: Server execution failed"
> when declaring new Word.ApplicationClass().
>
> string fileName = this.btnWorkOrder1.Value;
> object readOnly = false;
> object isVisible = false;
> object saveChanges = false;
> object missing = System.Reflection.Missing.Value;
> object dynamic = 2;
>
> //error here:
> Word.ApplicationClass oWordApp = new Word.ApplicationClass();
>
> Word.Document oWordDoc = oWordApp.Documents.Open(ref file, ref missing,
ref
> readOnly, ref missing, ref missing, ref missing, ref missing, ref missing,
> ref missing,
> ref missing, ref missing, ref isVisible);
>
>
> Does anybody know how to solve it? Please help!!!
>
> Thanks alot!!!
>
>
> Handy Mulia
- Next message: Dominick Baier [DevelopMentor]: "Re: SAML"
- Previous message: jt: "Re: SAML"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]