Repository URL to install this package:
|
Version:
2.2.2-1 ▾
|
U:RDoc::NormalClass[iI"
WIN32OLE:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"K<code>WIN32OLE</code> objects represent OLE Automation object in Ruby.;To:RDoc::Markup::BlankLine o; ;[I"@By using WIN32OLE, you can access OLE server like VBScript.;T@o; ;[I"Here is sample script.;T@o:RDoc::Markup::Verbatim;[I"require 'win32ole'
;TI"
;TI"/excel = WIN32OLE.new('Excel.Application')
;TI"excel.visible = true
;TI"'workbook = excel.Workbooks.Add();
;TI")worksheet = workbook.Worksheets(1);
;TI"Gworksheet.Range("A1:D1").value = ["North","South","East","West"];
;TI"1worksheet.Range("A2:B2").value = [5.2, 10];
;TI"&worksheet.Range("C2").value = 8;
;TI"'worksheet.Range("D2").value = 20;
;TI"
;TI"'range = worksheet.Range("A1:D2");
;TI"range.select
;TI""chart = workbook.Charts.Add;
;TI"
;TI"workbook.saved = true;
;TI"
;TI"$excel.ActiveWorkbook.Close(0);
;TI"excel.Quit();
;T:@format0o; ;[
I"DUnfortunately, Win32OLE doesn't support the argument passed by ;TI"reference directly. ;TI"KInstead, Win32OLE provides WIN32OLE::ARGV or WIN32OLE_VARIANT object. ;TI"JIf you want to get the result value of argument passed by reference, ;TI"4you can use WIN32OLE::ARGV or WIN32OLE_VARIANT.;T@o;;[I")oleobj.method(arg1, arg2, refargv3)
;TI"Qputs WIN32OLE::ARGV[2] # the value of refargv3 after called oleobj.method
;T;0o; ;[I"or;T@o;;[ I"*refargv3 = WIN32OLE_VARIANT.new(XXX,
;TI"H WIN32OLE::VARIANT::VT_BYREF|WIN32OLE::VARIANT::VT_XXX)
;TI")oleobj.method(arg1, arg2, refargv3)
;TI"Ip refargv3.value # the value of refargv3 after called oleobj.method.;T;0:
@fileI"ext/win32ole/win32ole.c;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [U:RDoc::Constant[i I"VERSION;TI"WIN32OLE::VERSION;T00o;;[o; ;[I" Version string of WIN32OLE.;T;
@@;0@@@cRDoc::NormalClass0U;[i I" ARGV;TI"WIN32OLE::ARGV;T00o;;[o; ;[I"IAfter invoking OLE methods with reference arguments, you can access ;TI"*the value of arguments by using ARGV.;T@o; ;[I"EIf the method of OLE(COM) server written by C#.NET is following:;T@o;;[I"-void calcsum(int a, int b, out int c) {
;TI" c = a + b;
;TI"}
;T;0o; ;[I"Dthen, the Ruby OLE(COM) client script to retrieve the value of ;TI";argument c after invoking calcsum method is following:;T@o;;[I"a = 10
;TI"b = 20
;TI"c = 0
;TI" comserver.calcsum(a, b, c)
;TI"p c # => 0
;TI"(p WIN32OLE::ARGV # => [10, 20, 30]
;T;0o; ;[I"LYou can use WIN32OLE_VARIANT object to retrieve the value of reference ;TI"2arguments instead of refering WIN32OLE::ARGV.;T;
@@;0@@@@L0U;[i I"CP_ACP;TI"WIN32OLE::CP_ACP;T00o;;[o; ;[I"BANSI code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;F;
@@;0@@@@L0U;[i I"
CP_OEMCP;TI"WIN32OLE::CP_OEMCP;T00o;;[o; ;[I"AOEM code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;F;
@@;0@@@@L0U;[i I"
CP_MACCP;TI"WIN32OLE::CP_MACCP;T00o;;[o; ;[I"2;T;
@@;0@@@@L0U;[i I"CP_THREAD_ACP;TI"WIN32OLE::CP_THREAD_ACP;T00o;;[o; ;[I">current thread ANSI code page. See WIN32OLE.codepage and ;FI"WIN32OLE.codepage=.;F;
@@;0@@@@L0U;[i I"CP_SYMBOL;TI"WIN32OLE::CP_SYMBOL;T00o;;[o; ;[I"Dsymbol code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;F;
@@;0@@@@L0U;[i I"CP_UTF7;TI"WIN32OLE::CP_UTF7;T00o;;[o; ;[I"CUTF-7 code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;F;
@@;0@@@@L0U;[i I"CP_UTF8;TI"WIN32OLE::CP_UTF8;T00o;;[o; ;[I"CUTF-8 code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;F;
@@;0@@@@L0U;[i I"LOCALE_SYSTEM_DEFAULT;TI"$WIN32OLE::LOCALE_SYSTEM_DEFAULT;T00o;;[o; ;[I"Bdefault locale for the operating system. See WIN32OLE.locale ;FI"and WIN32OLE.locale=.;F;
@@;0@@@@L0U;[i I"LOCALE_USER_DEFAULT;TI""WIN32OLE::LOCALE_USER_DEFAULT;T00o;;[o; ;[I"Adefault locale for the user or process. See WIN32OLE.locale ;FI"and WIN32OLE.locale=.;F;
@@;0@@@@L0[ [[I"
class;T[[:public[[I"
codepage;TI"ext/win32ole/win32ole.c;T[I"codepage=;T@Ç[I"connect;T@Ç[I"const_load;T@Ç[I"create_guid;T@Ç[I"locale;T@Ç[I"locale=;T@Ç[I"new;T@Ç[I"
ole_free;T@Ç[I"ole_reference_count;T@Ç[I"ole_show_help;T@Ç[:protected[ [:private[ [I"
instance;T[[;[[I"[];T@Ç[I"[]=;T@Ç[I"_getproperty;T@Ç[I"_invoke;T@Ç[I"_setproperty;T@Ç[I" each;T@Ç[I"invoke;T@Ç[I"method_missing;T@Ç[I"ole_activex_initialize;T@Ç[I"
ole_free;T@Ç[I"ole_func_methods;T@Ç[I"ole_get_methods;T@Ç[I"ole_method;T@Ç[I"ole_method_help;T@Ç[I"ole_methods;T@Ç[I"ole_obj_help;T@Ç[I"ole_put_methods;T@Ç[I"ole_query_interface;T@Ç[I"ole_respond_to?;T@Ç[I"
ole_type;T@Ç[I"ole_typelib;T@Ç[I"setproperty;T@Ç[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@@@@cRDoc::TopLevel