Đối tượng đề cập đến một đối tượng COM đã được thuyết minh bằng cách sử dụng quá trình instantiation mới được mô tả trước đây. Method_name tham số dùng để chỉ một phương pháp mà là một phần của lớp đại diện bởi các đối tượng. | Chapter 15 The object refers to a COM object that has been instantiated using the new instantiation process described previously. The parameter method_name refers to a method that is part of the class represented by object. The optional parameter space specified by method_value can be used to input parameters to those methods that allow or require input. Its syntax is just like that of a normal function with each input parameter separated by a comma. If you wanted to open a new MS Word document after instantiating a new COM object pointing to the application as seen in the previous example you could simply reference the method that accomplishes this. This is the add method in the Documents subclass of word word- Documents- Add Notice how this follows a very logical OOP-style syntax. Executing this will result in a new document being displayed to the MS Word application window. com_get The function com_get is used to retrieve COM object properties. Its syntax is mixed com_get resource object string property The input parameter object points to an instantiated COM object and property refers to an attribute in the class represented by the instantiated object. Instantiate a new object pointing to the MS Word application word new COM or die Couldn t start Word The CapsLock property is either 0 for No or 1 for Yes. flag com_get word- Application CapsLock Turn flag value 0 or 1 into human-readable format if flag 1 flag YES else flag NO endif display appropriate message print CAPS Lock activated flag word- Quit 402 JavaScript and COM Alternatively you could retrieve the CapsLock attribute value by calling it just as you would call an object s attribute via OOP syntax. To use this alternative format in the above example simply replace this line in the above example flag com_get word- Application CapsLock with this line flag word- Application- CapsLock Making use of these object attributes you can retrieve any variety of information about the characteristics