From: David Mullet Date: 2008-06-02T01:14:12+09:00 Subject: Re: Check for Open Application Not Thisguy 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 http://rubyonwindows.blogspot.com http://rubyonwindows.blogspot.com/search/label/word -- Posted via http://www.ruby-forum.com/.