new Word.ApplicationClass() (impersonation)

U

Utku Selamoglu

Hi,
I have a problem with the MS-WORD Automation. I have done lots of things but
couldn't find a solution for...

When I write <identity impersonate="true" userName="Administrator"
password="pass"> to the "WEB.CONFIG" file in the project, the object creation
of "new Word.ApplicationClass()" finishes immediately. But on the other hand
if I don't modify the "WEB.CONFIG" the automation works also, but the object
creation takes almost 20-25 seconds to be done.(user should not wait that
much, if I use the modified "WEB.CONFIG" it is very fast).

So, I have tried lots of things to solve this problem. I used
DCOMCNFG("Microsoft Word Document",COM Object) changed lots of things to make
the object creation to be more faster but still couldn't have the solution.

I have to add one thing that with "WEB.CONFIG" everything is okey but I Have
to do without entering the "USERNAME" and "PASSWORD" to the "WEB.CONFIG"
because in this project we are not allowed to write the
Administrator(USERNAME,PASSWORD) of the server in the "WEB.CONFIG".(We don't
have an access to the "SERVER" as an administrator, the company we work for
don't give us that access, we have only access for the "INETPUB" folder for
making changes, installing the new versions of the application).

I am using MS-WORD Automation to create reports so users should not wait
more than 10 - 15 seconds. Is there any other alternatives(solutions) that
the object creation "Word.ApplicationClass()" runs like I modified the
"WEB.CONFIG".

I hope the explanation of the solution is clearly explains the problem.
Thanks a lot.
Utku Selamoglu
(e-mail address removed)
 
N

Norman Yuan

Automating Officce desktop application on web server is stringly not
recommneded and almost guarantee you unexpected problems, especially when
you do not have routine access to the web server, then you would be called
to troubleshooting very often and to be blamed for crashing the web server.
Whenever possible, I'd run away from that kind of solution (technically, it
always possible).
 
U

Utku Selamoglu

Hi norman,
thanks for your reply.

Yes you are right on that but for now there is no problem. Still working on
th web server. IUSR has a permission to access WORD Document COM Object so it
works but my problem is the timing. It takes to much time to create a new
instance from the WORD Document Object if the user of that application logins
as a IUSR_Machine
but if I impersonate the user as an administrator for example in
"WEb.Config" or IIS Manager under the "Default Web Site->Directory
Security->Edit->Anonymous access" if I change the username and password with
the "Administrator" instead of the IUSR_Machine both works and the new
instance of the WORD COM Object being created on the code side very fast. My
main prblem is the speed of the object creation on the server side in the
code. (The Admininstrator impersonated user creates fast- IUSR_Machine user
creates really slow).

Thanks a lot again.
 
M

Mario G.

Hi Utku,

Unfortunately I don't have an answer to your question but have a question of
my own in which you may have already solved. I am also utilizing Word
Automation via a Web Service with Word 2007. Through the IDE things run
perfectly, however on the web server I recieve an
"System.UnauthorizedAccessException..." error message. I cannot get the
Interactive User to work. If I select the "launching user" identity, it will
instantiate Word but I believe it's the incorrect version (i.e. 2003 vs.
2007) based on the class ID.

Any ideas?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top