From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../microsoft_extensions/activexobject/index.html | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 files/ja/archive/web/javascript/microsoft_extensions/activexobject/index.html (limited to 'files/ja/archive/web/javascript/microsoft_extensions/activexobject/index.html') diff --git a/files/ja/archive/web/javascript/microsoft_extensions/activexobject/index.html b/files/ja/archive/web/javascript/microsoft_extensions/activexobject/index.html new file mode 100644 index 0000000000..63682a9940 --- /dev/null +++ b/files/ja/archive/web/javascript/microsoft_extensions/activexobject/index.html @@ -0,0 +1,92 @@ +--- +title: ActiveXObject +slug: Archive/Web/JavaScript/Microsoft_Extensions/ActiveXObject +translation_of: Archive/Web/JavaScript/Microsoft_Extensions/ActiveXObject +--- +
{{JSRef}}
+ +
Warning: このオブジェクトはMicrosoft拡張であり、Internet Explorerでのみサポートされます。Windows 8.x Store appではサポートされません。
+ +

The ActiveXObject Object enables and returns a reference to an automation object.

+ +

This object is used only to instantiate automation objects, and has no members.

+ +

Syntax

+ +
let newObj = new ActiveXObject(servername.typename[, location])
+
+ +

Parameters

+ +
+
servername
+
オブジェクトを提供するアプリケーションの名前。
+
typename
+
The type or class of the object to create.
+
location {{optional_inline}}
+
The name of the network server where the object is to be created.
+
+ +

Remarks

+ +

Automation servers provide at least one type of object. For example, a word-processing application may provide an application object, a document object, and a toolbar object.

+ +

You may be able to identify servername.typename values on a host PC in the HKEY_CLASSES_ROOT registry key. For example, here are a few examples of values you may find there, depending on which programs are installed:

+ + + +
+

Important: ActiveX objects may present security issues. To use the ActiveXObject, you may need to adjust security settings in Internet Explorer for the relevant security zone. For example, for the local intranet zone, you typically need to change a custom setting to "Initialize and script ActiveX controls not marked as safe for scripting."

+
+ +

To identify members of an automation object that you can use in your code, you may need to use a COM object browser, such as the OLE/COM Object Viewer, if no reference documentation is available for the Automation object.

+ +

To create an Automation object, assign the new ActiveXObject to an object variable:

+ +
var ExcelApp = new ActiveXObject("Excel.Application");
+var ExcelSheet = new ActiveXObject("Excel.Sheet");
+
+ +

This code starts the application creating the object (in this case, a Microsoft Excel worksheet). Once an object is created, you refer to it in code using the object variable you defined. In the following example, you access properties and methods of the new object using the object variable ExcelSheet and other Excel objects, including the application object and the ActiveSheet.Cells collection.

+ +
// Make Excel visible through the Application object.
+ExcelSheet.Application.Visible = true;
+// Place some text in the first cell of the sheet.
+ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A, row 1";
+// Save the sheet.
+ExcelSheet.SaveAs("C:\\TEST.XLS");
+// Close Excel with the Quit method on the Application object.
+ExcelSheet.Application.Quit();
+
+ +

Requirements

+ +

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Not supported in Windows 8.x Store apps.

+ +
+

Note: Creating an ActiveXObject on a remote server is not supported in Internet Explorer 9 standards mode, Internet Explorer 10 standards mode, Internet Explorer 11 standards mode, and Windows Store apps or later.

+
+ +

See also

+ + -- cgit v1.2.3-54-g00ecf