Hi all, I am creating MS word document using ruby. can I use a "template" document in Microsoft word with place holders for dynamic data from database using ruby. Like, I''ve a template, I want to fill it by data from database, using ruby. Please help me out. Thanks, -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
As far as i can see, just use ''open'' on the template file instead of a normal document. Don''t use this file to save though. Again, this is the Ruby on Rails board. Please ask Win32OLE-specific questions at the ruby board. Second, Rubys Win32OLE gives you _everything_ that can be accomplished with OLE. Please refer to the corresponding documentation or the msdn. As your questions are not on _how_ to use OLE but which part of OLE to use, this might be a better idea. Thanks Skade -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
aveo wrote:> Hi all, > I am creating MS word document using ruby. can I use a "template" > document in Microsoft word with place holders for dynamic data from > database using ruby. > Like, I''ve a template, I want to fill it by data from database, using > ruby. > Please help me out. > > Thanks,As Skade mentioned, open the template as you would a regular document... word = WIN32OLE.new(''Word.Application'') doc = word.Documents.Open(''Contemporary Resume.dot'') ...and save it as a regular document... doc.SaveAs(''Contemporary Resume.doc'') As mentioned, you''ll want to take this particular topic off this board. Feel free to visit my blog and/or send email with questions about Ruby and Windows, MS Office, etc. David http://rubyonwindows.blogspot.com -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---