Javascript example tutorial (20) OLEAutomation (1)

Source: Internet
Author: User
Javascript example tutorial (20) OLEAutomation (1) use OLE Automation in javaScript

We have mentioned OLE Automation in Javascript in the previous tutorial. In this tutorial, we will discuss how JavaScript can use the powerful functions of Automation to expand the capabilities of server scripts.

Automation is not a new thing. It has been popular several years ago, but it is a new application supported by ActiveX Scripting Language. If you already have Visual Basic or Visual C ++ programming background, this tutorial will introduce how to use your experience to create useful scripts to control external applications.

It is very powerful to control external applications in your scripts, such as opening a Word document or an Excel spreadsheet from your scripts. The HTML editor, such as HomeSite 4.0 and HotMetal PRo 6, provides you with a variety of tools that you can use to go to your home page. They are encapsulated in ActiveX controls. This tutorial mainly includes:

What is Automation?

What is binding

How to create a new instance of the Automation Object

How to retrieve instances of an Automation Object

How to process Application Instances

How to Improve the Performance of the script program

How to process set objects

From the next article, we will introduce the above content one by one.

Use OLE Automation in JavaScript

What is Automation?

OLE Automation allows applications to communicate, exchange data, and control other applications. It also allows a customer application to create and control an object by using the exposed object interface. An Automation object is an object that can be exposed to other applications or programming tools through the Automation interface.

Automation provides a standard file creation and access method. Automation is usually closely related to Visual Basic. It provides C/C ++ developers with powerful tools to create programmable applications and allows Visual Basic designers to access and operate these applications. These C/C ++ programmers provide professional user interface solutions and provide Visual Basic programmers with a reliable way to collect custom solutions from application components.

Not only can Visual Basic use Automation, but in fact, programmable objects can also be accessed by any macro language or programming tool that executes Automation. You can select a programming tool based on your current knowledge, instead of learning a new language for each application. Even if the script language, such as VBScript and Jscript pages, supports Automation.

The key to controlling an Automation application is to have a good understanding of the Object Model of the application. The object model of each application is different. Microsoft claims that every function of every application in the Office program group can be accessed by programmers through the object model of the application. This Office program group exposes thousands of objects, methods, and attributes to programmers through its object model. This message is undoubtedly good news for programmers.

However, it is usually difficult to learn the object models of special applications, because there is a lack of documents to describe various software objects. Microsoft Office applications, such as providing many documents for programmers online, but many other applications do not provide necessary documents.

In Microsoft Visaul Basic, the object browser displays constants of objects, methods, attributes, and external Automation objects in the dialog box. This tool also applies to script design because the global constants of the application are not valid in the script environment. If you use Automation to write scripts, you can apply the Object Browser to retrieve the required constant values, so that you can explicitly specify them in the script.

The above is the content of the Javascript instance tutorial (20) OLE Automation (1). For more information, see PHP Chinese Network (www.php1.cn )!

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.