--- In [email protected], "Sheri" <sheri...@...> wrote:
> com.set_arg_types("iv",1)
> local myselect=appRef.ActiveDocument.TextFrames.Item(5)
local myselect=appRef.ActiveDocument.TextFrames.Item(5)
and
local myselect=appRef.ActiveDocument.TextFrames(5)
May or may not be designed to work in version you have at the moment.
I believe way I had it was that "iv" was meant to apply to _every_
method/accessor that followed, and that would include
appRef.ActiveDocument
which of course would fail
Ok, I guess I can relax rules about set_arg_types so it's ignored for any
following method/accessor that has no arguments, if if non-persistent only dies
after the first method/accessor with args.
But what about
local appRef = com.create_object("Excel.Application")
local hCell = appRef.ActiveWorkbook.Worksheets(1).Cells(1, 1).value
?
(I'm impressed with Bruce's parsing: the last works).
Okay, looks like I gotta go one more step, and allow set_arg_types to have
multiple type_specs. The last arg, if present and 1/0 is persistence flags,
all the rest are type_specs. type_specs consumed in order, one for each
method/accessor with arguments. If persistence in force, when last type_spec
consumed, go back and start over with first.
Very easy to screw up in a script, and very hard for me to error check
(I have no way of telling, for instance, whether a particular method/accessor
and its args are in a chain or stand on their own).
?