84件ヒット
[1-84件を表示]
(0.013秒)
種類
- インスタンスメソッド (48)
- 特異メソッド (24)
- クラス (12)
ライブラリ
- win32ole (84)
クラス
- WIN32OLE (24)
-
WIN32OLE
_ EVENT (24) -
WIN32OLE
_ TYPE (24)
キーワード
-
WIN32OLE
_ EVENT (12) -
default
_ event _ sources (12) - handler= (12)
-
ole
_ func _ methods (12) - progids (12)
検索結果
先頭5件
-
WIN32OLE
# each {|i| . . . } -> () (18119.0) -
オブジェクトの列挙インターフェイスを呼び出してアイテム単位にブロックを 実行します。
...行します。
OLEオートメーションサーバの中には、コレクション用インターフェイスを持つ
ものがあります。eachメソッドは、このようなオブジェクトの列挙メソッドを
呼び出して、アイテム毎のイテレーションを行います......イスをサポートしてい
ない場合に通知します。
excel = WIN32OLE.new('Excel.Application')
book = excel.workbooks.add
sheets = book.worksheets(1)
cells = sheets.cells("A1:A5")
cells.each do |cell|
cell.value = 10
end
excel.Quit... -
WIN32OLE
# ole _ func _ methods -> [WIN32OLE _ METHOD] (12.0) -
オブジェクトのファンクション情報をWIN32OLE_METHODの配列として返し ます。
...合などに発生します。
excel = WIN32OLE.new('Excel.Application')
excel.visible = true
excel.ole_func_methods.each do |fun|
if fun.name.upcase == 'QUIT'
excel._invoke(fun.dispid, [], [])
break
end
end
@see WIN32OLE#ole_methods, WIN32OLE#ole_get_methods,... -
WIN32OLE
_ EVENT (12.0) -
OLEオートメーションサーバからのイベント通知を制御するクラスです。
...'DocumentComplete') do |disp, uri|
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}" #=> ダウンロード=http://www.ruby-lang.org/ja/downloads/ など
end
disp.quit
b = true
end
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do... -
WIN32OLE
_ EVENT # handler=(obj) -> () (12.0) -
イベント処理を実行するオブジェクトを登録します。
...ize
@completed = false
end
attr_reader :completed
def onDocumentComplete(disp, uri)
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}"
end
@completed = true
end
def method_missing(id, *args)
puts "event=#{id.t......event.handler = IeHandler.new
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if event.handler.completed
WIN32OLE_EVENT.message_loop
end
ie.Quit
WIN32OLE_EVENT#on_eventなどの呼び出しでブロックが登録されている場
合、そちらが優先されます。... -
WIN32OLE
_ EVENT . message _ loop -> () (12.0) -
Windowsのメッセージポンプを実行します。
...'DocumentComplete') do |disp, uri|
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}" #=> ダウンロード=http://www.ruby-lang.org/ja/downloads/ など
end
disp.quit
b = true
end
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do... -
WIN32OLE
_ TYPE # default _ event _ sources -> [WIN32OLE _ TYPE] (12.0) -
型が持つソースインターフェイスを取得します。
...= type.default_event_sources[0]
class WebEvent
def initialize
@completed = false
end
attr_reader :completed
end
source.ole_methods.each do |m|
WebEvent.module_eval do
define_method("on#{m.name}") do |*arg|
if arg[0] == "ページが表示されました"
@com......ndler = WebEvent.new
ctl.navigate2 'http://www.ruby-lang.org/'
loop do
break if evt.handler.completed
WIN32OLE_EVENT.message_loop
end
ctl.Quit
このプログラムを実行するとWindows7のIE8環境では以下のような出力を得られ
ます。
2010-10-06 22:33:54 +0900: Prope... -
WIN32OLE
_ TYPE . progids -> [String] (12.0) -
システムに登録されているすべてのコンポーネントクラスのPROGIDを取得します。
...E.progids.each do |pg|
if pg =~ /excel\.application/i # ExcelのPROGIDをバージョン無視で取り出す
excel = WIN32OLE.new(pg)
break
end
end
unless excel
$stderr.puts "Excel isn't installed"
exit(1)
end
excel.visible = true
# ...
excel.Quit
PROGID...