From: Craig Demyanovich Date: 2007-08-23T08:16:43+09:00 Subject: Re: Ruby & Word 2007 help ------=_Part_138776_24188294.1187824600469 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I don't have Word 2007 here, so I can't duplicate your environment. However, here are a couple questions that I'd ask myself at this point. Has the Word object model changed in Word 2007 in some way that doesn't work as expected but doesn't cause a noticeable error message? Might there be a file format conversion dialog that simply isn't being shown in front of Word and which is waiting for you to answer? If I think of anything else, I'll reply again. Good luck. Craig On 8/22/07, Inge Zwart wrote: > > Craig, > > Thanks for your e-mail. It is stopping at the Open command - it opens > Word > but then doesn't load the first document. > > I'm running a macro on a bunch of Word documents that sets the paper trays > for printing. > > Thanks again for your help. > > Inge > > Inge H. Zwart, RN, BSN > TeleTrans, Inc. > Medical Transcription Specialists since 1989 > Phone: 623-505-4423 / 877-495-9041 > Fax: 623-505-4423 > -----Original Message----- > From: Craig Demyanovich [mailto:cdemyanovich@gmail.com] > Sent: Wednesday, August 22, 2007 2:34 PM > To: ruby-talk ML > Subject: Re: Ruby & Word 2007 help > > 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_138776_24188294.1187824600469--