• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. Advanced Word Hacks > 87. Hack Word from Ruby

Hack Word from Ruby

Use Word from Ruby to create attractive printouts of HTML documents on the fly.

Ruby is a newer language than Perl or Python, and it works very well as a tool to automate Word. This hack shows you how to use Ruby to import an HTML document into Word, tweak the formatting, save the document in native Word format, and print it out to the default printer. This hack assumes you have a file named C:\resume.html on your system. It also assumes that you have Ruby installed on your system and that you can run Ruby scripts from the DOS command line.

Tip

To download a free version of Ruby for Windows, go to http://rubyforge.org.

Because Ruby supports COM automation [Hack #84] , you can access Word from within a Ruby script using the win32ole module, which the standard Windows Ruby distribution includes.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint