From: Damjan Rems Date: 2009-06-29T21:46:13+09:00 Subject: Automate Word OLE32 merge printing with Ruby What I would like to do is automate merge print documents without user interference. I have come so far: fso = WIN32OLE.new("Scripting.FileSystemObject") word = WIN32OLE.new('Word.Application') path = fso.GetAbsolutePathName(ARGV.first) doc = word.Documents.Open(path) path = fso.GetAbsolutePathName('some.xls') doc.MailMerge.OpenDataSource(path) My questions: At the line: doc.MailMerge.OpenDataSource(path) Words asks for choosing table (which is actualy a worksheet in excel file). How can this be supresses or set automaticaly? How to print all resulting documents? Recorded macro says: With ActiveDocument.MailMerge .Destination = wdSendToPrinter .SuppressBlankLines = True With .DataSource .FirstRecord = 1 .LastRecord = 1 End With .Execute Pause:=False end by TheR -- Posted via http://www.ruby-forum.com/.