Hello,
I am trying to write a simple script and all I need to do is check if
there is all ready a running instance of the word application. I look
and couldn’t find much on google how to do this…which probably means
it’s really easy, so I’m sorry for this post but I’m still learning 
Thanks in advance for your help!
koooee
In article [email protected],
Not T. [email protected] wrote:
there is all ready a running instance of the word application. I look
Microsoft Word?
and couldn’t find much on google how to do this…which probably means
Which OS?
On the Mac you can use Apple Events or NSWorkspace through various
bridges.
Not T. wrote:
Hello,
I am trying to write a simple script and all I need to do is check if
there is all ready a running instance of the word application. I look
and couldn’t find much on google how to do this…which probably means
it’s really easy, so I’m sorry for this post but I’m still learning 
Thanks in advance for your help!
koooee
One option is to try to connect to a running instance of Word. If there
is no running instance of Word, a WIN32OLERuntimeError exception will be
raised. So you could do the following:
require ‘win32ole’
begin
word = WIN32OLE.connect(‘Word.Application’)
rescue WIN32OLERuntimeError
word = WIN32OLE.new(‘Word.Application’)
word.Visible = true
end
David
David M. wrote:
One option is to try to connect to a running instance of Word. If there
is no running instance of Word, a WIN32OLERuntimeError exception will be
raised. So you could do the following:
require ‘win32ole’
begin
word = WIN32OLE.connect(‘Word.Application’)
rescue WIN32OLERuntimeError
word = WIN32OLE.new(‘Word.Application’)
word.Visible = true
end
David
http://rubyonwindows.blogspot.com
Ruby on Windows: word
Awsome thank you so much!!