Microsoft Word document : Word « Windows Platform « Ruby






Microsoft Word document


require 'win32ole'
# Creates OLE object to word
word = WIN32OLE.new("word.application")
word['Visible'] = TRUE;
word.documents.Add
0.upto(10){
        word.selection.TypeText(Text="Hello Ruby Relatives!")
        word.selection.TypeParagraph
}
word.close()

 








Related examples in the same category

1.Using WIN32OLE with word
2.Write the Code to Insert Data into Word
3.Open a word file and print it out