How to use ASP & Config word (Word.Application) This is learn/tutorial asp developers how to using ASP and Config COM Word (Word.Applciation)
ShotDev Focus:
- ASP & Config Word.Application
Solution
Error Type:
Server object, ASP 0178 (0×80070005)
The call to Server.CreateObject failed while checking permissions. Access is denied to this object.
/myasp/asp_word_connect, line 9
or Windows 2003 Server
Server object error ‘ASP 0177 : 800401f3′
Server.CreateObject Failed
/myasp/asp_word_connect.asp, line 9
Solve Problem
Goto Control Panel -> Administrative Tools -> Event Viewer
Click Event Viewer
User IUSR_WEERACHAI error.
Open Component Services
Click DCOM Config
Right Click Microsoft Word Application -> Properties
On tab Security Click Edit
Click Add
Click Adacned..
Add New user IUSR_Machine-name และ IWAM_Machine-name
Click OK
and Select All Allow
Click OK.
.
.
Example
asp_word_connect.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Dim WrdApp Set WrdApp = Server.CreateObject("Word.Application") If IsObject(WrdApp) Then Response.write("Word.Application Status Connected.") Else Response.write("Cannot Connect to Word.Application") End IF %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_word_connect.asp
Screenshot