I get this error. does anyone know why? thanks for the help.
C:/PROGRA~1/Ruby/work/bell05/efo~7.rb:14:in `method_missing': Information
(WIN32OLERuntimeError)
OLE error code:0 in <Unknown>
<No Description>
HRESULT error code:0x8002000e
Invalid number of parameters. from
C:/PROGRA~1/Ruby/work/bell05/efo~7.rb:14
The offending command works when executed in VBWord.
I get this error. does anyone know why? thanks for the help.
C:/PROGRA~1/Ruby/work/bell05/efo~7.rb:14:in `method_missing': Information
(WIN32OLERuntimeError)
OLE error code:0 in <Unknown>
<No Description>
HRESULT error code:0x8002000e
Invalid number of parameters. from
C:/PROGRA~1/Ruby/work/bell05/efo~7.rb:14
The offending command works when executed in VBWord.
The above is not a correct translation of the VB code you are using:
curpos = Selection.Information(wdHorizontalPositionRelativeToPage)
wdHorizontalPositionRelativeToPage is a constant integer whose value is 5.
(Try printing it or displaying it in a msgbox from Word/VBA.
Furthermore, Information has a required argument, and you need to pass that
as a Ruby argument rather than using the operator as you're doing here.
Try this:
WdHorizontalPositionRelativeToPage = 5
curpos = selection.Information(WdHorizontalPositionRelativeToPage)
or this:
module Word; end # you can use whatever name you like instead of Word
WIN32OLE.const_load(w, Word)
curpos = selection.Information(WdHorizontalPositionRelativeToPage)
The above is not a correct translation of the VB code you are using:
curpos = Selection.Information(wdHorizontalPositionRelativeToPage)
wdHorizontalPositionRelativeToPage is a constant integer whose value is 5.
(Try printing it or displaying it in a msgbox from Word/VBA.
Furthermore, Information has a required argument, and you need to pass
that as a Ruby argument rather than using the operator as you're doing
here.
Try this:
WdHorizontalPositionRelativeToPage = 5
curpos = selection.Information(WdHorizontalPositionRelativeToPage)
or this:
module Word; end # you can use whatever name you like instead of Word
WIN32OLE.const_load(w, Word)
curpos = selection.Information(WdHorizontalPositionRelativeToPage)