From: Craig Demyanovich Date: 2007-08-23T05:33:53+09:00 Subject: Re: Ruby & Word 2007 help ------=_Part_137432_6670209.1187814429733 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm not sure I can help, but I'm interested in what you're doing. However, you didn't provide details of the failure(s); please do so. Craig On 8/22/07, Inge Zwart wrote: > > I have a batchmacro that I use in Ruby with Word 2003. I converted to > Word > 2007 and now it doesn't work. Can anyone tell me how to change the code? > The code is below: > > > # batchmacro.rb > # Ruby script for batch running Word macros > > require 'win32ole' > > # Launch new instance of Word > wrd = WIN32OLE.new('Word.Application') > > wrd.Visible = 1 > > # First argument to script is the name of the macro > macro1 = ARGV.shift() > > # Everything else is a document on which to run the macro > ARGV.each do |file| > doc = wrd.Documents.Open(File.expand_path(file)) > wrd.Run(macro1) > doc.Save() > doc.Close() > end > > wrd.Quit() > > ------=_Part_137432_6670209.1187814429733--