Hi, it is my first time here for help. I could not get createObject(““word.application””) working but I got createObject working for all other applications like access, excel. the error number I got is 2147418111 (Call was rejected by callee). I tried to add version number .9 after application and it is not working neither. Please help! thanks!

Shawn:

A little Google search on ‘word “ole automation” vbscript’ returned the
following resource, which might help solve your problem. I believe another
member mentioned that you have to set .Visible = True as is done below.
That might explain why something that was working with Excel is not working
with Word.

a.

from: VanDyke.com - Page Not Found
via: VanDyke.com - Page Not Found


$language = “VBScript”

$interface = “1.0”

’ This script uses the GetObject() call to first attempt to connect to
’ a running instance of MS Word. If that fails a call to CreateObject()
’ attempts to start Word, make it visible and maximizes it.

Sub Main

Dim obj

’ Request to handle errors ourselves so we can handle possible failure
’ of GetObject() to connect to Word…

Hi again Shawn:

OK, here’s the part where you have to provide a lot more information about
your environment and the code you’re working on for this group to be of
more help. In what context are you using vbscript? Where is the Microsoft
Word executable installed? What is the environment? That sort of thing.
Also, I don’t see your original code sample here anymore.

One little thing to try before responding with all that info, is making
sure you have the case correct in your create object code. For example,
the code in the subject line of this email says ‘createObject
(“word.application”)’ and you say you’ve had success before with
Excel.Application and Access.Application in whatever context you’re working
in. You might try ‘CreateObject(“Word.Application”)’ instead and see if
it’s nothing more than a case sensitivity problem with your class-name.

Otherwise, write back with a more detailed run-down of your problem, and
perhaps that will help folks help you better.

good luck,

alice funke
Ottawa, Canada

Thanks for teh suggestions. I have been searching everywhere but
could not find an answer. In microsoft support site, it says to
do automation, step one is: “For Microsoft Word 2000, add a
reference to the Microsoft Office 9.0 object library and to the
Microsoft Word 9.0 object library”. is this true for using
vbscript? fi so, how to add?

Or .Visible = vbTrue

“Word.Application” is the correct reference, but I seem to remember that
there is something else you need to do with MSWord that is not required for
the others. Something like a call to the Show() method after you’ve
created the object. Sorry I can’t be more specific, but try searching at
support.microsoft.com.

good luck,

alice funke
Ottawa, Canada