--- In [email protected], "entropyreduction" <alancampbelllists+ya...@...> wrote: > > > > --- In [email protected], "Sheri" <sherip99@> wrote: > > > Here it states that to use a default value, the optional variant value must > > test as "missing". Possibly the result of initializing the empty variant. > > > <http://msdn.microsoft.com/en-us/library/aa164532%28office.10%29.aspx> > > It also says "Note that any parameter that is marked as > optional--meaning you can omit the value and Word will pick a > reasonable default value or ignore that option--is marshalled as > a pointer to a VARIANT in Word (Excel doesn't typically use a > pointer to a VARIANT for optional parameters so you don't have > this by ref issue for most of Excel)." > > And sure enough if you look at signature for CheckSpelling, lots > of VARIANTs, no VARIANT*s (VARIANT* is a sign I should use ByRef > -- in fact I probably change output from description methods so > that's what you see).
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.
