Hi, Jonathan.

If you specify an empty string as the first parameter of GetObject, you'll 
create a new instance of the object (it's essentially the same as calling 
CreateObject). So, doing this:

Set w = GetObject("", "Word.Application")

Would create a new Word.Application object.

If you want to get an object from a running instance, omit the first parameter 
completely. For example, to get the current Word Application object, start 
Word, then do:

Set w = GetObject(, "Word.Application")

Thanks,

Aaron

--
Aaron Smith
Web Development * App Development * Product Support Specialist
Ai Squared * 725 Airport North Office Park, Fort Wayne, IN 46825
260-489-3671 * www.aisquared.com

To insure that you receive proper support, please include all past 
correspondence (where applicable), and any relevant information pertinent to 
your situation when submitting a problem report to the Ai SquaredTechnical 
Support Team.

From: Jonathan C. Cohn [mailto:jon.c.c...@gmail.com]
Sent: Tuesday, October 7, 2014 7:22 AM
To: gw-scripting@gwmicro.com
Subject: GetObject syntax / function

I am having issues reproducing a GetObject() command I am using in a JAWS 
script to work in WindowEyes. In JAWS  GetObject(R"eflection.Session"). Note 
that in JAWS this takes just one argument. After invoking this command I can 
act directly with the scriptable objects of the current session. In VBS with 
WindowEyes the GetObject requires two parameters, where the second parameter 
appears to be equivalent to the parameter that JAWS uses.


If I use a null string for the first parameter then Reflection creates a new 
hidden window. If I use the path of the Reflections settings file then I get a 
new session to the host. If I leave the first parameter completely blank, I get 
back an ActiveX error.  What am I missing here?


Thanks in advance for any hints.Best wishes,

Jonathan



Reply via email to