Class: WIN32OLE_METHOD

Inherits:
Object
  • Object
show all
Defined in:
win32ole.c,
win32ole.c

Overview

WIN32OLE_METHOD objects represent OLE method information.

Instance Method Summary collapse

Constructor Details

#new(ole_type, method) ⇒ WIN32OLE_METHOD object

Returns a new WIN32OLE_METHOD object which represents the information about OLE method. The first argument ole_type specifies WIN32OLE_TYPE object. The second argument method specifies OLE method name defined OLE class which represents WIN32OLE_TYPE object.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')


4422
4423
4424
# File 'win32ole.c', line 4422

static VALUE
folemethod_initialize(self, oletype, method)
VALUE self;

Instance Method Details

#dispidObject

Returns dispatch ID.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.dispid # => 181


4953
4954
4955
# File 'win32ole.c', line 4953

static VALUE
folemethod_dispid(self)
VALUE self;

#event?Boolean

Returns true if the method is event.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
puts method.event? # => true

Returns:

  • (Boolean)


4768
4769
4770
# File 'win32ole.c', line 4768

static VALUE
folemethod_event(self)
VALUE self;

#event_interfaceObject

Returns event interface name if the method is event.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
puts method.event_interface # =>  WorkbookEvents


4790
4791
4792
# File 'win32ole.c', line 4790

static VALUE
folemethod_event_interface(self)
VALUE self;

#helpcontextObject

Returns help context.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.helpcontext # => 65717


4919
4920
4921
# File 'win32ole.c', line 4919

static VALUE
folemethod_helpcontext(self)
VALUE self;

#helpfileObject

Returns help file. If help file is not found, then the method returns nil.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.helpfile # => C:\...\VBAXL9.CHM


4886
4887
4888
# File 'win32ole.c', line 4886

static VALUE
folemethod_helpfile(self)
VALUE self;

#helpstringObject

Returns help string of OLE method. If the help string is not found, then the method returns nil.

tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser')
method = WIN32OLE_METHOD.new(tobj, 'Navigate')
puts method.helpstring # => Navigates to a URL or file.


4853
4854
4855
# File 'win32ole.c', line 4853

static VALUE
folemethod_helpstring(self)
VALUE self;

#invkindObject

Returns the method invoke kind.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.invkind # => 1


4622
4623
4624
# File 'win32ole.c', line 4622

static VALUE
folemethod_invkind(self)
VALUE self;

#invoke_kindObject

Returns the method kind string. The string is “UNKNOWN” or “PROPERTY” or “PROPERTY” or “PROPERTYGET” or “PROPERTYPUT” or “PROPERTYPPUTREF” or “FUNC”.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.invoke_kind # => "FUNC"


4642
4643
4644
# File 'win32ole.c', line 4642

static VALUE
folemethod_invoke_kind(self)
VALUE self;

#nameObject Also known as: to_s

call-seq

WIN32OLE_METHOD#name

Returns the name of the method.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.name # => SaveAs


4456
4457
4458
# File 'win32ole.c', line 4456

static VALUE
folemethod_name(self)
VALUE self;

#offset_vtblObject

Returns the offset ov VTBL.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.offset_vtbl # => 40


4987
4988
4989
# File 'win32ole.c', line 4987

static VALUE
folemethod_offset_vtbl(self)
VALUE self;

#paramsObject

returns array of WIN32OLE_PARAM object corresponding with method parameters.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
p method.params # => [Filename, FileFormat, Password, WriteResPassword,
                      ReadOnlyRecommended, CreateBackup, AccessMode,
                      ConflictResolution, AddToMru, TextCodepage,
                      TextVisualLayout]


5119
5120
5121
# File 'win32ole.c', line 5119

static VALUE
folemethod_params(self)
VALUE self;

#return_typeObject

Returns string of return value type of method.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.return_type # => Workbook


4491
4492
4493
# File 'win32ole.c', line 4491

static VALUE
folemethod_return_type(self)
VALUE self;

#return_type_detailObject

Returns detail information of return value type of method. The information is array.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
p method.return_type_detail # => ["PTR", "USERDEFINED", "Workbook"]


4565
4566
4567
# File 'win32ole.c', line 4565

static VALUE
folemethod_return_type_detail(self)
VALUE self;

#return_vtypeObject

Returns number of return value type of method.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.return_vtype # => 26


4528
4529
4530
# File 'win32ole.c', line 4528

static VALUE
folemethod_return_vtype(self)
VALUE self;

#size_opt_paramsObject

Returns the size of optional parameters.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.size_opt_params # => 4


5056
5057
5058
# File 'win32ole.c', line 5056

static VALUE
folemethod_size_opt_params(self)
VALUE self;

#size_paramsObject

Returns the size of arguments of the method.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.size_params # => 11


5022
5023
5024
# File 'win32ole.c', line 5022

static VALUE
folemethod_size_params(self)
VALUE self;

#visible?Boolean

Returns true if the method is public.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.visible? # => true

Returns:

  • (Boolean)


4682
4683
4684
# File 'win32ole.c', line 4682

static VALUE
folemethod_visible(self) 
VALUE self;