WIN32OLE MS Word Help

Hi all,
I am trying to create word document in ruby using WIN32OLE.

require 'win32ole'
word ="Word.Application")
word.visible = true
selection = word.selection
word.Selection.TypeText "This is some text."

Can we set header and footer to document? I want to generate a
document such that its header contains an image on right side and a
note on left side. please help me out.

Try the following code:

Playing with this a little more I came up with this: