
What Objects Are Scriptable?
It isn't such simple to estimate whether objects are scripteable.
First you need to know which objects are registered. You can
use OLE/COM viewer from Microsoft (as Marc suggested).
Within this viewer you can get also the ProgID code of the object.
Then you need to know about the object's methods and properties.
Here you can use Object Browser (provided by MS Office Apps,
VC, VB etc.).
If you successful identity an object, there may be several hurdles
preventing you to script it. First of all, many objects provided from
ocx-files developed by Microsoft requires a licensing. For instance
WinSock.ocx won't run, if no MS Development environment is
installed. Same for Common Dialogs access and so on.
Then there is a question whether the component is visible. All visible
objects need a window for embedding. This is the reason why you
can't access many common controls from Microsoft or the Acrobat
Reader OCX. The trick you can use is: Embed the control into a
HTML page and use IE to view the page. Then you can control the
object trought the IE application object.
Have a look at the WSH Bazaar. There are several samples discussing
scripting other objects. Chapter 2 of the sneak preview discusses also
OLE/COM viewer, Object browser and more.
G. Born
Check out the WSH Bazaar at:
www.borncity.de
Phil Hill schrieb in Nachricht ...
Quote:
>I'm very new to WSH and COM and was surprised to find that I could use
>WinSock in a VBScript.
>In VBScript you perform a WScript.CreateObject on"MSWinsock.Winsock".
>I found this out only by seeing someone else's code. The VB Object
>Browser calls WinSock "MSWinSockLib"
>I guess I have two questions:
>How do you get a list of scriptable objects on your machine (NT 4)?
>How do you enumerate a scriptable objects methods and properties?
>Thanks,
>Phil