Class: WIN32OLE_TYPE
- Inherits:
-
Object
- Object
- WIN32OLE_TYPE
- Defined in:
- win32ole.c,
win32ole.c
Overview
WIN32OLE_TYPE objects represent OLE type libarary information.
Class Method Summary collapse
-
.ole_classes(typelib) ⇒ Object
Returns array of WIN32OLE_TYPE objects defined by the typelib type library.
-
.progids ⇒ Object
Returns array of ProgID.
-
.typelibs ⇒ Object
Returns array of type libraries.
Instance Method Summary collapse
-
#guid ⇒ Object
Returns GUID.
-
#helpcontext ⇒ Object
Returns helpcontext.
-
#helpfile ⇒ Object
Returns helpfile path.
-
#helpstring ⇒ Object
Returns help string.
-
#new(typelib, ole_class) ⇒ WIN32OLE_TYPE object
constructor
Returns a new WIN32OLE_TYPE object.
-
#major_version ⇒ Object
Returns major version.
-
#minor_version ⇒ Object
Returns minor version.
-
#name ⇒ Object
(also: #to_s)
Returns OLE type name.
-
#ole_methods ⇒ Object
Returns array of WIN32OLE_METHOD objects which represent OLE method defined in OLE type library.
-
#ole_type ⇒ Object
returns type of OLE class.
-
#progid ⇒ Object
Returns ProgID if it exists.
-
#src_type ⇒ Object
Returns source class when the OLE class is 'Alias'.
-
#typekind ⇒ Object
Returns number which represents type.
-
#variables ⇒ Object
Returns array of WIN32OLE_VARIABLE objects which represent variables defined in OLE class.
-
#visible? ⇒ Boolean
Returns true if the OLE class is public.
Constructor Details
#new(typelib, ole_class) ⇒ WIN32OLE_TYPE object
Returns a new WIN32OLE_TYPE object. The first argument typelib specifies OLE type library name. The second argument specifies OLE class name.
WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application')
# => WIN32OLE_TYPE object of Application class of Excel.
3462 3463 3464 |
# File 'win32ole.c', line 3462 static VALUE foletype_initialize(self, typelib, oleclass) VALUE self; |
Class Method Details
.ole_classes(typelib) ⇒ Object
Returns array of WIN32OLE_TYPE objects defined by the typelib type library.
3267 3268 3269 |
# File 'win32ole.c', line 3267 static VALUE foletype_s_ole_classes(self, typelib) VALUE self; |
.progids ⇒ Object
Returns array of ProgID.
3352 3353 3354 |
# File 'win32ole.c', line 3352 static VALUE foletype_s_progids(self) VALUE self; |
.typelibs ⇒ Object
Returns array of type libraries.
3304 3305 3306 |
# File 'win32ole.c', line 3304 static VALUE foletype_s_typelibs(self) VALUE self; |
Instance Method Details
#guid ⇒ Object
Returns GUID. tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') puts tobj.guid # => 00024500-0000-0000-C000-000000000046
3600 3601 3602 |
# File 'win32ole.c', line 3600 static VALUE foletype_guid(self) VALUE self; |
#helpcontext ⇒ Object
Returns helpcontext. If helpcontext is not found, then returns nil. tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') puts tobj.helpfile # => 131185
3897 3898 3899 |
# File 'win32ole.c', line 3897 static VALUE foletype_helpcontext(self) VALUE self; |
#helpfile ⇒ Object
Returns helpfile path. If helpfile is not found, then returns nil. tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') puts tobj.helpfile # => C:...VBAXL9.CHM
3867 3868 3869 |
# File 'win32ole.c', line 3867 static VALUE foletype_helpfile(self) VALUE self; |
#helpstring ⇒ Object
Returns help string. tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser') puts tobj.helpstring # => Web Browser interface
3799 3800 3801 |
# File 'win32ole.c', line 3799 static VALUE foletype_helpstring(self) VALUE self; |
#major_version ⇒ Object
Returns major version. tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') puts tobj.major_version # => 8
3704 3705 3706 |
# File 'win32ole.c', line 3704 static VALUE foletype_major_version(self) VALUE self; |
#minor_version ⇒ Object
Returns minor version. tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') puts tobj.minor_version # => 2
3736 3737 3738 |
# File 'win32ole.c', line 3736 static VALUE foletype_minor_version(self) VALUE self; |
#name ⇒ Object Also known as: to_s
Returns OLE type name. tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') puts tobj.name # => Application
3501 3502 3503 |
# File 'win32ole.c', line 3501 static VALUE foletype_name(self) VALUE self; |
#ole_methods ⇒ Object
Returns array of WIN32OLE_METHOD objects which represent OLE method defined in OLE type library. tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') methods = tobj.ole_methods.collect{|m| m.name }
=> ['Activate', 'Copy', 'Delete',....]
3992 3993 3994 |
# File 'win32ole.c', line 3992 static VALUE foletype_methods(argc, argv, self) int argc; |
#ole_type ⇒ Object
returns type of OLE class. tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') puts tobj.ole_type # => Class
3563 3564 3565 |
# File 'win32ole.c', line 3563 static VALUE foletype_ole_type(self) VALUE self; |
#progid ⇒ Object
Returns ProgID if it exists. If not found, then returns nil. tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') puts tobj.progid # => Excel.Application.9
3635 3636 3637 |
# File 'win32ole.c', line 3635 static VALUE foletype_progid(self) VALUE self; |
#src_type ⇒ Object
Returns source class when the OLE class is 'Alias'. tobj = WIN32OLE_TYPE.new('Microsoft Office 9.0 Object Library', 'MsoRGBType') puts tobj.src_type # => I4
3836 3837 3838 |
# File 'win32ole.c', line 3836 static VALUE foletype_src_type(self) VALUE self; |
#typekind ⇒ Object
Returns number which represents type. tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') puts tobj.typekind # => 4
3769 3770 3771 |
# File 'win32ole.c', line 3769 static VALUE foletype_typekind(self) VALUE self; |
#variables ⇒ Object
Returns array of WIN32OLE_VARIABLE objects which represent variables defined in OLE class. tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') vars = tobj.variables vars.each do |v| puts "#WIN32OLE_TYPE.vv.name = #WIN32OLE_TYPE.vv.value" end
The result of above sample script is follows:
xlChart = -4109
xlDialogSheet = -4116
xlExcel4IntlMacroSheet = 4
xlExcel4MacroSheet = 3
xlWorksheet = -4167
3971 3972 3973 |
# File 'win32ole.c', line 3971 static VALUE foletype_variables(self) VALUE self; |
#visible? ⇒ Boolean
Returns true if the OLE class is public. tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') puts tobj.visible # => true
3672 3673 3674 |
# File 'win32ole.c', line 3672 static VALUE foletype_visible(self) VALUE self; |