I can't start the Word object

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default I can't start the Word object

    Hi all,

    In my aspx page, I initial the Word object like this:

    - Microsoft.Office.Interop.Word.ApplicationClass app = new
    ApplicationClass();

    but the IIS response "Access is denied".

    I appreciate any response.


    ghostnguyen Guest

  2. Similar Questions and Discussions

    1. Error creating Word.Application object in ASP.NET
      I have created a very simple ASP.NET page for testing purposes. I am trying to create a Word.Application object, populate a document with some text...
    2. CF MX6.1 will not auto start after server reboot.. but will start by hand...
      I just moved all the stuff to a new dual Xeon Windows server 2003. Problem with CF MX 6.1 is that it will not start after a server reboot! I get...
    3. Editing Word documents in Perl (Openoffice Writer or MS Word)
      Hello, I want to read and edit openoffice / staroffice writer documents. Does anyone know of any modules for that? Ideally, I would've liked a...
    4. how do i indent the start of a new paragraph on pasted test from word
      I worked it out hold ctrl shift together then press space no need to reply thanks!
    5. in object, declare array values at start or in constructor?
      Zurab Davitiani <agt@mindless.com> wrote in message news:<2e9Ka.1807 Whoa!!! Thanks for that. I did follow the link and read what it says. I have...
  3. #2

    Default Re: I can't start the Word object

    That's because the IIS account does not have permissions to launch the Word
    application.

    On the server running IIS:

    1. Start -> Run dcomcnfg.exe
    2. Expand Component Services
    3. Expand Computers
    4. Expand My Computer
    5. Expand DCOM config
    6. Select Microsoft Word Document
    7. Right-click and select properties
    8. Click on the security tab
    9. Under Launch and Activation permissions select Customize and click on
    Edit
    10. Add the following users ASPNET, IUSR_<machinename>, IWAM_<machinename>
    and NETWORK SERVICE if IIS running on Win2K3

    Gabriel Lozano-Morán
    Software Engineer
    Sogeti


    Gabriel Lozano-Morán Guest

  4. #3

    Default Re: I can't start the Word object

    Thanks for your intruction.

    I can initial WordApp object but I can't initial WordFile object. This's my
    code:

    Microsoft.Office.Interop.Word.ApplicationClass app = new ApplicationClass();
    // Ok
    Microsoft.Office.Interop.Word.Document doc = new DocumentClass(); //Fail

    Exception Details: System.Runtime.InteropServices.COMException: Server
    execution failed.

    In addition, is it a good idea if I apply Word automation in Webpage?



    "Gabriel Lozano-Morán" <gabriel.lozano@no-spam.com> wrote in message
    news:eReLL2USFHA.3972@TK2MSFTNGP14.phx.gbl...
    > That's because the IIS account does not have permissions to launch the
    > Word application.
    >
    > On the server running IIS:
    >
    > 1. Start -> Run dcomcnfg.exe
    > 2. Expand Component Services
    > 3. Expand Computers
    > 4. Expand My Computer
    > 5. Expand DCOM config
    > 6. Select Microsoft Word Document
    > 7. Right-click and select properties
    > 8. Click on the security tab
    > 9. Under Launch and Activation permissions select Customize and click on
    > Edit
    > 10. Add the following users ASPNET, IUSR_<machinename>, IWAM_<machinename>
    > and NETWORK SERVICE if IIS running on Win2K3
    >
    > Gabriel Lozano-Morán
    > Software Engineer
    > Sogeti
    >

    ghostnguyen Guest

  5. #4

    Default Re: I can't start the Word object

    > Microsoft.Office.Interop.Word.Document doc = new DocumentClass(); //Fail
    >
    > Exception Details: System.Runtime.InteropServices.COMException: Server
    > execution failed.
    You need to perform the same steps as for the Microsoft Word Application but
    now for the Microsoft Word Document
    > In addition, is it a good idea if I apply Word automation in Webpage?
    >
    That depends on the project you are working on and on what you are trying to
    establish. But I would consider putting these things in a seperate .NET
    assembly. Doing so you don't need to give the IIS user accounts permissions
    for Word application and you make your application more scalable.

    Gabriel Lozano-Morán


    LOZANO-MORÁN, Gabriel Guest

  6. #5

    Default Re: I can't start the Word object

    Hi

    In DCOM Config, I see only the "Microsoft Word Document". There is no
    "Microsoft Word Application".
    My machine installed Office 2003.
    >> But I would consider putting these things in a seperate .NET assembly
    As I understand your idea, I think if I create an assembly A that operates
    with Office and my WebApp calls A. A still runs under "NET SERVICE" account
    and gives the same problem.

    Ghost Nguyen


    "LOZANO-MORÁN, Gabriel" <gabriel.lozano@no-spam.com> wrote in message
    news:unAJD2WSFHA.2348@TK2MSFTNGP09.phx.gbl...
    >> Microsoft.Office.Interop.Word.Document doc = new DocumentClass(); //Fail
    >>
    >> Exception Details: System.Runtime.InteropServices.COMException: Server
    >> execution failed.
    >
    > You need to perform the same steps as for the Microsoft Word Application
    > but
    > now for the Microsoft Word Document
    >
    >> In addition, is it a good idea if I apply Word automation in Webpage?
    >>
    >
    > That depends on the project you are working on and on what you are trying
    > to
    > establish. But I would consider putting these things in a seperate .NET
    > assembly. Doing so you don't need to give the IIS user accounts
    > permissions
    > for Word application and you make your application more scalable.
    >
    > Gabriel Lozano-Morán
    >
    >

    ghostnguyen Guest

  7. #6

    Default Re: I can't start the Word object

    You could use impersonation in the seperate assembly

    Gabriel Lozano-Morán

    "ghostnguyen" <ghostnguyen@yahoo.com> wrote in message
    news:es$ErEtSFHA.3140@TK2MSFTNGP14.phx.gbl...
    > Hi
    >
    > In DCOM Config, I see only the "Microsoft Word Document". There is no
    > "Microsoft Word Application".
    > My machine installed Office 2003.
    >
    >>> But I would consider putting these things in a seperate .NET assembly
    >
    > As I understand your idea, I think if I create an assembly A that operates
    > with Office and my WebApp calls A. A still runs under "NET SERVICE"
    > account and gives the same problem.
    >
    > Ghost Nguyen
    >
    >
    > "LOZANO-MORÁN, Gabriel" <gabriel.lozano@no-spam.com> wrote in message
    > news:unAJD2WSFHA.2348@TK2MSFTNGP09.phx.gbl...
    >>> Microsoft.Office.Interop.Word.Document doc = new DocumentClass(); //Fail
    >>>
    >>> Exception Details: System.Runtime.InteropServices.COMException: Server
    >>> execution failed.
    >>
    >> You need to perform the same steps as for the Microsoft Word Application
    >> but
    >> now for the Microsoft Word Document
    >>
    >>> In addition, is it a good idea if I apply Word automation in Webpage?
    >>>
    >>
    >> That depends on the project you are working on and on what you are trying
    >> to
    >> establish. But I would consider putting these things in a seperate .NET
    >> assembly. Doing so you don't need to give the IIS user accounts
    >> permissions
    >> for Word application and you make your application more scalable.
    >>
    >> Gabriel Lozano-Morán
    >>
    >>
    >
    >

    Gabriel Lozano-Morán Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139