Re: word.applicaton, Object required: '[undefined]' by Shiva
Shiva
Sun Jan 28 00:47:02 CST 2007
Thank you very much i'll try it.
It found another way to avoid the failure, i changed the code to this
one:
<script Language="VBScript">
Set objWord = Server.CreateObject("word.application")
</script>
<%
path = "C:\inetpub/wwwroot/dxb/files/"
path= path & newsrs("strNews")
objDoc = objWord.Documents.Open(path)
Doc = objDoc(newsrs("strNews")).Content
newstext = Left(Doc.Text, 100)
It creates the object now, when i try to open it client side, and i
think that might be better anyway due to the performence and the
server utilisation. But i got confused because of the path, if i try
to open the document in the client side script the path shows to the c
drie o the client, if i try to open the file in the server side code,
i get the error object required in the line of
onjWord.Documents.Open(path)
On 27 Jan., 19:23, mr_unreliable <kindlyReplyToNewsgr...@notmail.com>
wrote:
> You might try testing the instantiation, using the
> built-in vbs testing capabilities:
>
> Set Word = CreateObject("word.application")
> MsgBox(IsObject(Word)) ' should return "True"
> MsgBox(VarType(Word)) ' i get "8", but expected "9"???
> MsgBox(TypeName(Word)) ' should return "Application"
>
> This is to verify that the object was created as expected.
>
> Note that the "VarType(Word)" function returned an "8"
> for me -- which implies a string variable, whereas I had
> expected a "9" which implies an automation object. However,
> your code _does_ work as expected here.
>
> cheers, jw
>
>
>
> Shiva wrote:
> > Yes Word is installed.
>
> > It's weird though. I added at the beginning of my page following line
>
> > <Response.ContentType = "application/vnd.ms-word">
>
> > And i still get the same error.- Zitierten Text ausblenden -- Zitierten Text anzeigen -