Hello

I'm trying to make some kind of a news administration, so the
administrators should be able to upload or create new articels.
Therefore i wanted to open a blank word document where they can write
there article.
At the moment my code looks like that:

Set Word = CreateObject("word.application")
word.visible = true
Set Doc = Word.Documents.Add

Not that much i know, but i alsways get the error

Object required: '[undefined]' at the line of

set doc = word.document.add

Does everyone know what the problem could be.

Thanks for any help

Re: word.applicaton, Object required: '[undefined]' by mr_unreliable

mr_unreliable
Thu Jan 25 11:54:18 CST 2007

Shiva, your code works for me.

Do you happen to have ms word installed on your system?

cheers, jw

Shiva wrote:
> Hello
>
> I'm trying to make some kind of a news administration, so the
> administrators should be able to upload or create new articels.
> Therefore i wanted to open a blank word document where they can write
> there article.
> At the moment my code looks like that:
>
> Set Word = CreateObject("word.application")
> word.visible = true
> Set Doc = Word.Documents.Add
>
> Not that much i know, but i alsways get the error
>
> Object required: '[undefined]' at the line of
>
> set doc = word.document.add
>
> Does everyone know what the problem could be.
>
> Thanks for any help
>

Re: word.applicaton, Object required: '[undefined]' by Shiva

Shiva
Sat Jan 27 01:50:06 CST 2007

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.



On 25 Jan., 21:54, mr_unreliable <kindlyReplyToNewsgr...@notmail.com>
wrote:
> Shiva, your code works for me.
>
> Do you happen to have ms word installed on your system?
>
> cheers, jw
>
>
>
> Shiva wrote:
> > Hello
>
> > I'm trying to make some kind of a news administration, so the
> > administrators should be able to upload or create new articels.
> > Therefore i wanted to open a blank word document where they can write
> > there article.
> > At the moment my code looks like that:
>
> > Set Word = CreateObject("word.application")
> > word.visible = true
> > Set Doc = Word.Documents.Add
>
> > Not that much i know, but i alsways get the error
>
> > Object required: '[undefined]' at the line of
>
> > set doc = word.document.add
>
> > Does everyone know what the problem could be.
>
> > Thanks for any help- Zitierten Text ausblenden -- Zitierten Text anzeigen -


Re: word.applicaton, Object required: '[undefined]' by mr_unreliable

mr_unreliable
Sat Jan 27 09:23:02 CST 2007

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.
>

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 -