Creating Word Document Issue

Discussion in 'ASP .Net Security' started by Arvind P Rangan, Feb 16, 2005.

  1. Hi all,

    trying to create word document using following syntax in c#

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

    Application throws error as :
    Exception Details: System.UnauthorizedAccessException: Access is denied.

    The ASP.NET process is not authorized to access the requested resource. For
    security reasons the default ASP.NET process identity is
    '{machinename}\ASPNET', which has limited privileges. Consider granting
    access rights to the resource to the ASP.NET process identity.

    To grant ASP.NET write access to a file, right-click the file in Explorer,
    choose "Properties" and select the Security tab. Click "Add" to add the
    "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the
    Write box in the Allow column.

    But as per the security goes, i have ensured that machine\aspnet user has
    full access to the folder and even i gave the full access to C: but still
    the same error is showing. Can anyone help me on this.

    Thanks
    Arvind
    Arvind P Rangan, Feb 16, 2005
    #1
    1. Advertising

  2. Arvind,

    In the document
    http://support.microsoft.com/default.aspx?scid=kb;en-us;257757 you will find
    that Microsoft is strongly against using office automation on server side.
    Nevertheless if you insist, you can do it. Try giving permission to ASPNET
    user account to access word application
    object. It can be done with dcomcnfg.exe

    Eliyahu


    "Arvind P Rangan" <> wrote in message
    news:...
    > Hi all,
    >
    > trying to create word document using following syntax in c#
    >
    > private Word.ApplicationClass oWordApp = new Word.ApplicationClass();
    >
    > Application throws error as :
    > Exception Details: System.UnauthorizedAccessException: Access is denied.
    >
    > The ASP.NET process is not authorized to access the requested resource.

    For
    > security reasons the default ASP.NET process identity is
    > '{machinename}\ASPNET', which has limited privileges. Consider granting
    > access rights to the resource to the ASP.NET process identity.
    >
    > To grant ASP.NET write access to a file, right-click the file in Explorer,
    > choose "Properties" and select the Security tab. Click "Add" to add the
    > "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the
    > Write box in the Allow column.
    >
    > But as per the security goes, i have ensured that machine\aspnet user has
    > full access to the folder and even i gave the full access to C: but still
    > the same error is showing. Can anyone help me on this.
    >
    > Thanks
    > Arvind
    >
    >
    Eliyahu Goldin, Feb 16, 2005
    #2
    1. Advertising

  3. Hi,

    Maybe this will help
    http://msdn.microsoft.com/vbasic/de...n-us/odc_wd2003_ta/html/odc_wd_vbnettortf.asp

    Ken
    ---------------------
    "Arvind P Rangan" <> wrote in message
    news:...
    Hi all,

    trying to create word document using following syntax in c#

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

    Application throws error as :
    Exception Details: System.UnauthorizedAccessException: Access is denied.

    The ASP.NET process is not authorized to access the requested resource. For
    security reasons the default ASP.NET process identity is
    '{machinename}\ASPNET', which has limited privileges. Consider granting
    access rights to the resource to the ASP.NET process identity.

    To grant ASP.NET write access to a file, right-click the file in Explorer,
    choose "Properties" and select the Security tab. Click "Add" to add the
    "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the
    Write box in the Allow column.

    But as per the security goes, i have ensured that machine\aspnet user has
    full access to the folder and even i gave the full access to C: but still
    the same error is showing. Can anyone help me on this.

    Thanks
    Arvind
    Ken Tucker [MVP], Feb 16, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nikhil Patel

    creating word document in asp.net

    Nikhil Patel, May 12, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    980
    Nikhil Patel
    May 13, 2004
  2. Arvind P Rangan

    Creating Word Document Issue

    Arvind P Rangan, Feb 16, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    566
    Ken Tucker [MVP]
    Feb 16, 2005
  3. srk
    Replies:
    0
    Views:
    614
  4. srk
    Replies:
    0
    Views:
    586
  5. Michael G. Schneider

    Modifying a Word document without using Word Automation

    Michael G. Schneider, Dec 15, 2003, in forum: ASP General
    Replies:
    5
    Views:
    265
    el.c. - myLittleTools.net
    Dec 16, 2003
Loading...

Share This Page