--- In [email protected], "entropyreduction"
<alancampbelllists+ya...@...> wrote:
>
>
> COMplugin0.72_100114.zip
> in
> http://tech.groups.yahoo.com/group/power-pro/files/0_TEMP_/AlansPluginProvisional/
>
> ;don't have SpellingOptions in Excel 2000
Ugh, that's a shame. I was working on more demos that demostrate there is still
a problem with "t " for skipping.
Using Excel from Office 2003 and COMplugin0.72_100114 shows there is still an
issue.
' VB Script: TestSkipOptional.vbs
option explicit
Dim XLApp, udict, newdict, var
Set XLApp = CreateObject("Excel.Application")
XLApp.SpellingOptions.UserDict="Custom.dic"
udict=XLApp.SpellingOptions.UserDict
var=XLApp.CheckSpelling("HAX", , False)
newdict=XLApp.SpellingOptions.UserDict
msgbox "newdict: "&newdict&" (Expected "&udict&")"
XLApp.SpellingOptions.UserDict="SLP_PPROTest.dic"
udict=XLApp.SpellingOptions.UserDict
var=XLApp.CheckSpelling("HAX", , False)
newdict=XLApp.SpellingOptions.UserDict
msgbox "newdict: "&newdict&" (Expected "&udict&")"
Set XLApp=Nothing
' end VB Script
The VBA tagged parameters you showed previously do not work in VBScript
(haven't tried VBA). To skip optional parameters in VBScript, you leave a comma
positionally for missing parameters, e.g., var=XLApp.CheckSpelling("HAX", ,
False)
If I specify one of the optional parameters for CheckSpelling, it does change
that default going forward. In Excel 2003, those options are all properties of
the SpellingOptions object. E.g., XLApp.SpellingOptions.UserDict gets updated
if CustomDictionary is specified in the CheckSpelling method. But if I skip
one, that property is unchanged after CheckSpelling. FYI, the corresponding
property for IgnoreUpperCase is XLApp.SpellingOptions.IgnoreCaps. There is
another option to IgnoreMixedDigits (or not), but nothing for ignoring all
digits. Spell checking digits always returns True.
When the plugin runs the CheckSpelling method and one of the optional
parameters is specified (and not typespec'ed as "t ") in CheckSpelling method,
it works properly. But if the objective is to skip that argument, it doesn't
work. A typespec of "t " is clearing out the correponding property value
instead of using and retaining the prior existing value. So my question is, how
exactly are you processing what should be a skipped optional parameter? Are you
sending one of those special VT_Error Variants as described here:
<http://support.microsoft.com/kb/238981> ?
Here is the Powerpro version of above scriptlet. Maybe you can try it on
another box with a later version of Excel?
global com_status, com_type
exec.onerror("display")
local udict, newdict, res
local XLApp=com.create_object("Excel.Application")
if (com_status !=="OK") do
messagebox("OK", "Couldn't created object - quitting")
quit
endif
XLApp.SpellingOptions.UserDict="Custom.dic"
udict=XLApp.SpellingOptions.UserDict
com.set_arg_types("s t b ")
res=XLApp.CheckSpelling("HAX", "", 0)
newdict=XLApp.SpellingOptions.UserDict
messagebox("OK TopMost", "newdict: "++newdict++ ;;+
"(expected: "++udict++")")
XLApp.SpellingOptions.UserDict="SLP_PPROTest.dic"
udict=XLApp.SpellingOptions.UserDict
com.set_arg_types("s t b ")
res=XLApp.CheckSpelling("HAX", "skip_this.dic", 0)
newdict=XLApp.SpellingOptions.UserDict
messagebox("OK TopMost", "newdict: "++newdict++ ;;+
"(expected: "++udict++")")
com.unload
quit
Something else I tried (which further demonstrated that it wasn't using the
existing default dictionary) was adding HAX to SLP_PPROTest.dic. Even when not
ignoring all caps, that should cause a True result when spellchecking "HAX"
with skipped CustomDictionary. True in VBScript, False in Powerpro.
Yes, I had thought of trying to mimic the Indesign type problem with digits for
the dictionary name string. I even try making the typespec send "i " or "l "
for it and sending 1111. Currently no error gets generated for that.
Interrogating the XLApp.SpellingOptions.UserDict afterwards even returns the
digits.
Regards,
Sheri