JavaScript Instance Tutorial OLE Automation (1)

Source: Internet
Author: User
Tags object documentation interface object model ole access
javascript| Tutorial

Using OLE Automation in JavaScript

In the previous tutorial we have mentioned OLE Automation in JavaScript. In the tutorials in this section, we'll discuss how JavaScript leverages the power of automation to extend server-side scripting.

In fact, automation is not a new thing. It has been popular a few years ago, but the support of ActiveX scripting languages is a new application. If you already have visual Basic or Visual C + + programming backgrounds, this tutorial describes how you can use your experience to create useful scripts to control external applications.

Controlling external applications in your scripts is very powerful, such as opening a Word document or an Excel spreadsheet from your script. HTML editors such as HomeSite 4.0 and HoTMetaL Pro 6 provide you with a wealth of tools that you can use to get to your homepage. They are encapsulated in an ActiveX control. The main contents of this tutorial are:

What is automation

What is binding

How to create a new instance of a Automation object

How to retrieve an instance of the existence of a automation object

How to handle an instance of an application

How to improve the performance of a script program

How to work with set objects

From the beginning of the next article, we introduce the above content one after another.

Using OLE Automation in JavaScript

What is automation

OLE (object connection and Embedding) automation allows applications to complete communication, exchange data, and control other applications, and so on. It also allows a client application to create and control an object by using the interface of the exposed object. A Automation object is an object that can be exposed to other applications or programming tools through the Automation interface.

Automation provides a standard way to create and access applications in a document. Typically, automation is closely associated with Visual Basic. It provides a powerful tool for C + + developers to create programmable applications, and enables Visual Basic designers to access and manipulate these applications. These c/COM + + programmers provide a specialized user interface solution and provide Visual Basic programmers with a reliable way to assemble custom solutions from application components.

Not only can visual Basic take advantage of automation, but programmable objects can also be accessed in any macro language or in the execution of automation programming tools. Instead of learning new languages for each application, users can choose a programming tool based on current knowledge. Even scripting languages, such as VBScript and JScript pages, support automation.

The key to controlling an automation application is to have a better understanding of the application's object model. The object model for each application is different. Microsoft now claims that every function of every application in an Office program group can be accessed by programmers through the application's object model. This Office program group exposes thousands of objects, methods, and properties to programmers through its object model. This message is certainly good news for the program designer.

However, it is often difficult to learn the object model of a particular application because of the lack of relevant data documents that describe various software objects. Microsoft Office applications, such as providing many documentation for programmers on the web, but there are many other applications that do not provide the necessary documentation.

The Object Browser in Microsoft Visaul Basic shows the constants of objects, methods, properties, and external Automation objects in a dialog box. This tool also works in scripting, because the application's global constants are not valid in the scripting environment. If you use automation to write a script, you can apply the Object Browser to the values of the required constants so that you can explicitly specify them in the script.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.