Word Automation In ASP


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Word Automation In ASP

  1. #1
    Nick Hall Guest

    Word Automation In ASP

    Hi,

    I am having some problems with an application I am writing. It uses Word
    Automation server-side to do a search and replace on template documents,
    which are then presented to the user. I am using the information from the
    following Knowledge Base article: -

    HOWTO: Configure Office Applications for Automation from a COM+/MTS
    Package(http://support.microsoft.com/default...b;EN-US;288368)

    However, I am getting an error is being generated at the point at which the
    code attempts to load the template document: -

    5981 - Could not open macro storage.

    This seems to suggest that Word is not being run from the correct user
    account. I've confirmed this by looking at TaskManager on the server while
    the application is running. The DLLHost process that is hosting the
    application is correctly launched under the user account that I had
    configured for the purpose; however WINWORD.EXE is launched under the
    account IUSR_<machine_name>.

    The questions I have are as follows: -

    1. Has anyone successfully managed to implement the advice from this
    article?
    2. Are there any particular elements of the configuration of either DCOM or
    COM+ that could explain this behaviour?

    I am trying to automate Word '97, SR2. The server machine is running
    Windows 2000 Server, with IIS 5.

    Thanks in advance for any assistance that can be offered.

    Nick Hall



  2. #2
    Paul Clement Guest

    Re: Word Automation In ASP

    On Wed, 22 Jan 2003 11:52:34 -0000, "Nick Hall" <nickh@aslan.co.uk> wrote:

    Hi,

    I am having some problems with an application I am writing. It uses Word
    Automation server-side to do a search and replace on template documents,
    which are then presented to the user. I am using the information from the
    following Knowledge Base article: -

    HOWTO: Configure Office Applications for Automation from a COM+/MTS
    Package(http://support.microsoft.com/default...b;EN-US;288368)

    However, I am getting an error is being generated at the point at which the
    code attempts to load the template document: -

    5981 - Could not open macro storage.

    This seems to suggest that Word is not being run from the correct user
    account. I've confirmed this by looking at TaskManager on the server while
    the application is running. The DLLHost process that is hosting the
    application is correctly launched under the user account that I had
    configured for the purpose; however WINWORD.EXE is launched under the
    account IUSR_<machine_name>.

    The questions I have are as follows: -

    1. Has anyone successfully managed to implement the advice from this
    article?
    2. Are there any particular elements of the configuration of either DCOM or
    COM+ that could explain this behaviour?

    I am trying to automate Word '97, SR2. The server machine is running
    Windows 2000 Server, with IIS 5.

    Thanks in advance for any assistance that can be offered.

    There are a couple of KB articles that documents this issue as well. I would try the second one
    first since it's an easier fix:

    PRB: Error 800A175D - Could Not Open Macro Storage
    http://support.microsoft.com/default...b;en-us;224338

    INFO: Corrupt Normal.dot Causes Errors When Automating Word
    http://support.microsoft.com/default...b;en-us;247028


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

  3. #3
    Nick Hall Guest

    Re: Word Automation In ASP

    Hi,

    Thanks for the additional info. Unfortunately, I don't believe that this is
    the problem. I can get the automation to work successfully using the other
    two methods mentioned in the article :-

    INFO: Considerations for Server-Side Automation of Office
    (http://support.microsoft.com/default...b;EN-US;257757)

    I would prefer to use the COM+ Package solution, as it appears that it has
    the least impact on other applications; however if necessary I can go with
    one of the solutions.

    Nick Hall

    "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    news:919t2vckfhat0fq8388mdtkvql3s4j2f0o@4ax.com...
    > On Wed, 22 Jan 2003 11:52:34 -0000, "Nick Hall" <nickh@aslan.co.uk> wrote:
    >
    > Hi,
    >
    > I am having some problems with an application I am writing. It uses

    Word
    > Automation server-side to do a search and replace on template documents,
    > which are then presented to the user. I am using the information from

    the
    > following Knowledge Base article: -
    >
    > HOWTO: Configure Office Applications for Automation from a COM+/MTS
    > Package(http://support.microsoft.com/default...b;EN-US;288368)
    >
    > However, I am getting an error is being generated at the point at which

    the
    > code attempts to load the template document: -
    >
    > 5981 - Could not open macro storage.
    >
    > This seems to suggest that Word is not being run from the correct user
    > account. I've confirmed this by looking at TaskManager on the server

    while
    > the application is running. The DLLHost process that is hosting the
    > application is correctly launched under the user account that I had
    > configured for the purpose; however WINWORD.EXE is launched under the
    > account IUSR_<machine_name>.
    >
    > The questions I have are as follows: -
    >
    > 1. Has anyone successfully managed to implement the advice from this
    > article?
    > 2. Are there any particular elements of the configuration of either

    DCOM or
    > COM+ that could explain this behaviour?
    >
    > I am trying to automate Word '97, SR2. The server machine is running
    > Windows 2000 Server, with IIS 5.
    >
    > Thanks in advance for any assistance that can be offered.
    >
    > There are a couple of KB articles that documents this issue as well. I

    would try the second one
    > first since it's an easier fix:
    >
    > PRB: Error 800A175D - Could Not Open Macro Storage
    > http://support.microsoft.com/default...b;en-us;224338
    >
    > INFO: Corrupt Normal.dot Causes Errors When Automating Word
    > http://support.microsoft.com/default...b;en-us;247028
    >
    >
    > Paul ~~~ pclement@ameritech.net
    > Microsoft MVP (Visual Basic)




  4. #4
    Paul Clement Guest

    Re: Word Automation In ASP

    On Thu, 23 Jan 2003 09:30:45 -0000, "Nick Hall" <nickh@aslan.co.uk> wrote:

    Hi,

    Thanks for the additional info. Unfortunately, I don't believe that this is
    the problem. I can get the automation to work successfully using the other
    two methods mentioned in the article :-

    INFO: Considerations for Server-Side Automation of Office
    (http://support.microsoft.com/default...b;EN-US;257757)

    I would prefer to use the COM+ Package solution, as it appears that it has
    the least impact on other applications; however if necessary I can go with
    one of the solutions.


    Are you using Anonymous (non) authentication to your web site? The package may be running in the
    DLLHost process under an account you specified but it sounds like the web server credentials are
    being used when creating the process under which Word will be running.

    Does the web server account have access permissions to the folders where the templates are located?


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

  5. #5
    Nick Hall Guest

    Re: Word Automation In ASP

    Hi,

    Yes, the web site is configured to use the anonymous user. You're
    absolutely right though, it does appear that the Word process is being
    started in the context of the anonymous user instead of in the context of
    the COM+ package. Interestingly enough, I've just tried applying the same
    solution to an older machine with NT4 server/IIS 4/MTS installed and it
    works!! This suggests to me that the functionality may have been "broken"
    at some point in the evolution of IIS/MTS.

    In any case I think I've got enough information to be able to get a working
    solution together. Thanks for your help.

    Nick Hall

    "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    news:4qvv2v8ltfbl5chif3v241m1tfm44v9bpu@4ax.com...
    > On Thu, 23 Jan 2003 09:30:45 -0000, "Nick Hall" <nickh@aslan.co.uk> wrote:
    >
    > Hi,
    >
    > Thanks for the additional info. Unfortunately, I don't believe that

    this is
    > the problem. I can get the automation to work successfully using the

    other
    > two methods mentioned in the article :-
    >
    > INFO: Considerations for Server-Side Automation of Office
    > (http://support.microsoft.com/default...b;EN-US;257757)
    >
    > I would prefer to use the COM+ Package solution, as it appears that it

    has
    > the least impact on other applications; however if necessary I can go

    with
    > one of the solutions.
    >
    >
    > Are you using Anonymous (non) authentication to your web site? The package

    may be running in the
    > DLLHost process under an account you specified but it sounds like the web

    server credentials are
    > being used when creating the process under which Word will be running.
    >
    > Does the web server account have access permissions to the folders where

    the templates are located?
    >
    >
    > Paul ~~~ pclement@ameritech.net
    > Microsoft MVP (Visual Basic)




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center