Forum: Ruby win32ole question - how to get handle on currently running a

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fe57662c550fb3cce44c398ddf2dd706?d=identicon&s=25 itsme213 (Guest)
on 2006-03-11 20:44
(Received via mailing list)
I need to process a bunch of word files using win32ole.

 word = WIN32OLE.new('word.application')

starts a new word application instance each time it executes. Is there a
way
to get a hold of the currently running word app, if any?

Thanks.
Bfa670ef2303deb7dec5a8027367b30b?d=identicon&s=25 unknown (Guest)
on 2006-03-11 20:50
(Received via mailing list)
Use the connect method in place of the new method:

  word = WIN32OLE.connect('word.application')
D8fb06dfc08a477ecb0a76ffdbff3475?d=identicon&s=25 Chiaro Scuro (chiaroscuro)
on 2006-03-14 13:21
(Received via mailing list)
How would you choose between a number of different running instances of
an
application?
Bfa670ef2303deb7dec5a8027367b30b?d=identicon&s=25 unknown (Guest)
on 2006-03-14 14:45
(Received via mailing list)
You could use the WIN32OLE.connect method with the path and filename of
the open document in place of the ProgID:

xlWorkbook = WIN32OLE.connect('c:\SomeFolder\SomeFile.xls')

I have only tested this with Excel, but it should also work to obtain a
Word document object.

Mully
This topic is locked and can not be replied to.