Win32OLE word objects

Hi,

I’m fairly new to Ruby (and coding in general)and I’m having problems
trying to interact with objects in Word.

The word vba code I’m trying to replicate is as follows, basically I
don’t know how to recognise the dropdown and checkbox fields in Word.

ActiveDocument.FormFields(“PaxType2”).DropDown.Value = 3
ActiveDocument.FormFields(“PNRCheckBox”).CheckBox.Value = False
b = ActiveDocument.FormFields(“PNRCheckBox”).CheckBox.Value

Can anyone help, and also point me in the direction of how best to
source this info so as not to bother with these type of requests again.

Many thanks

I would have thought you could use your VBA code more or less verbatim.

See http://rubyonwindows.blogspot.com/search/label/word

Thanks, sometimes it’s the simple answer. The link to this file really
helps…http://msdn.microsoft.com/en-us/library/bb211855(v=office.12).aspx

Not sure why it wasn’t working before, maybe I was trying to be too cute

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs