Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WSH and Automation Objects Documentation

Status
Not open for further replies.

scripto

Technical User
Oct 20, 2003
9
GB
WSH works with COM objects that have an Automation interface.

How can I find what Objects are available, what kind of Interface they have (i.e. which are Automation objects), what their properties and methods are and how to drive them.

Can applications e.g. Adobe Acrobat can be "driven" from a VbScript
 
The reply from Mark57 is useful but only for VB and ActiveX objects. VBsctipt cannot access ActiveX objects only Automation objects (as far as I know). Any more info will be very much appreciated.
 
i agree with you.
maybe someone can post a list of objects available for vbscript?
 
VBScript can instantiate and manipulate all kinds of ActiveX objects. The limitation is usually related to data types, which the interface must be able to coerce to/from Variants.

I'm not clear about what you want to accomplish. Unless you have an Adobe's Acrobat product that exposes the necessary interfaces the answer is a qualified "no." I say qualified, because you might locate some 3rd party product that can handle Acrobat documents that does expose the necessary interfaces.
 
Interesting...

Things aren't as bad as some might make them out to be. It looks like Acrobat Reader offers a regular old ActiveX control as part of the standard installation. Maybe what you are running into is the fact that an ActiveX control requires a container and neither WSH nor ASP offers such a thing. As a result they are limited to simpler (or more complex) ActiveX objects that either do not require or provide their own "canvas."

Example:

pdffer.htm
Code:
<HTML>
  <HEAD>
    <META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
    <TITLE>VBScript PDF Demo</TITLE>
    <SCRIPT language=VBScript>
      Sub btnLoad_onclick()
        DPdf1.LoadFile &quot;ENUtxt.pdf&quot;
      End Sub
    </SCRIPT>
  </HEAD>
  <BODY>
    <DIV align=center>
      <INPUT type=button id=btnLoad value=&quot;Load PDF&quot;>
      <BR>
      <OBJECT id=DPdf1 style=&quot;LEFT: 0px; WIDTH: 600px; TOP: 0px; HEIGHT: 500px&quot; 
        classid=clsid:CA8A9780-280D-11CF-A24D-444553540000>
        <PARAM NAME=&quot;_Version&quot; VALUE=&quot;327680&quot;>
      </OBJECT>
    </DIV>
  </BODY>
</HTML>
This works perfectly well and is perfectly scriptable.

I'd suggest that if you want a desktop script you abandon WSH if you can and consider using IE as your script container. The best way of doing this is probably to write your script as an HTA which offers numerous advantages (but of course a few disadvantages of its own).

But maybe your question was a general one, and the &quot;control vs. object&quot; issue is the crux of the matter.
 
By now I've rambled all over the place, so I suppose one last post can't make matters worse.

Perhaps what you are looking for is an object browser like the ones built into the VS6 tools? This makes it easy to at least determine what methods and properties various ActiveX objects and controls expose, the parameters they accept, and so on.

Another tool I like is ActiveX Documenter at:


But this requires at least a VB5 (or VB6? I have both here) installation because of its dependence upon VB IDE components. The main thing I use it for is creating the &quot;skeleton&quot; of the documentation for my own ActiveX projects.

To go much beyond that of course you need to consult the vendor or developer's documentation for the software you are curious about.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top