--- In [email protected], "Sheri" <sheri...@...> wrote:
>
> --- In [email protected], "entropyreduction" 
> <alancampbelllists+yahoo@> wrote:
> > 
> > --- In [email protected], "Sheri" <sherip99@> wrote:
> > 
> > > OK, try this then. Create the VARIANT with VT_ERROR etc. Send a
> > > pointer to this VARIANT using VT_VARIANT|VT_BYREF. Its the only
> > > way to ensure that another process is going to see this VARIANT
> > > exactly the way you make it.
> > 
> > comPlugin0.72_100118.zip. I did that thing, but didn't test,
> > except that it seems a "t" though in at least one case: excel
> > getfilewSaveAs I think it was.
> 
> Oh well. Skipping the dictionary parameter for XLApp.CheckSpelling still uses 
> and sets the dictionary to empty string instead of using and retaining the 
> previously existing default. (too bad).

I'll remove default value substitution tomorrow.
 
> > Finally figured out how to get at least some extra error info
> > with IDispatch::Invoke fails. objApp.Help(4) in word now gives
> > mch same error as vbs.
> 
> Great! Tried it saw that, then tried in my InDesign Search test. Very 
> interesting result!
> 
> The error reported is not for the digits instead of string on Parameter #1 
> (For), but for string "0" instead of digit/boolean 0 on Parameter #2 
> (WholeWord). But I only get the error where chgVec[i,1] (Parameter #1) is 
> digits instead of string. The other invokes don't mind the value they are 
> receiving for Parameter #2 (which is unchanged; however I suppose the guesser 
> is sending zero, not "0" for those occurrences).
> 
> Error 770d: C:\Program Files\Adobe\Adobe InDesign CS2\InDesign.exe: Invalid 
> value for parameter 'WholeWord' of event 'Search'. Expected Boolean, but 
> received "0".
> 
> local r=myselect.Search(chgVec[i,1], wholeword, casesensitive, chgVec[i,2])
> 
> All the Search method's in parameters are Optional VARIANTs.

Yeah, that makes sense.  Remember, I do two passes.  You see error message for 
second pass.  Pass I: Guess.  Pass II: send everything in as strings (logical 
order: I keep track of whether any parameter was converted by guess in pass 
one: if no such conversion made, no point in Pass II).  

Only go on to Pass II if Pass I fails, so we deduce Pass I failed (probably 
because of arg 1 coming in as a number), and you see error msg on pass II.  
(I'll try later, but I think if whoever wrote the InDesign stuff knew what they 
were doing "0" would be accepted where a bool was expected, but that's by the 
by).  

I think you did local r=myselect.Search(chgVec[i,1], wholeword, casesensitive, 
chgVec[i,2]) equivalent in vbs and it worked?  
If so, my guess would be it worked because vbs has a numeric as well as a 
string type, and InDesign was able to convert a numeric 0 to a bool, and saw 
"333" or whatever chgVec[i,1] was as a string.

I _could_ do a Pass III, which would "guess, but less".  maybe only doing 
obvious booleans.  But unless many more methods that don;t seem to cope with 
VARIANTs come to light, I'm inclined to leave as is.








Reply via email to