Hi,
i am having problem with word automation. it is working fine in the local but it is not working in the terminal server.i am using word2003 professional and terminal server contains word 2003 standard. please anyone help.
Option Explicit
Private mwrdApp As Word.Application 'Holds Word instance
Private Sub Class_Initialize ()
Set mwrdApp = New Word.Application 'Create Word instance
End Sub
Private Sub Class_Terminate ()
mwrdApp.Quit 'Kill Word instance
Set mwrdApp = Nothing 'Kill reference
End Sub
Public Function GetWord () As Word.Application
Set GetWord = mwrdApp 'Return Word instance
End Function
Compile DLL.
ASP Code:
Put in directory with scripting permissions under IIS 4.0:
<%
Set WordServer = Server.CreateObject("Test.WordServer")
Set Word = WordServer.GetWord 'Get Word instance
Set Document = Word.Documents.Add 'Create new document
Document.Close 'Close document
Response.Write ("Word created & closed document successfully.")
%>
Thanks,
Kalees
|