use strict; use Win32::OLE; use Win32::OLE::Variant; my $obj = Win32::OLE->new('Server.SpellCheck') or die "Can not start server\n"; my $word = 'testt'; my $lang = 24941; my $dic = ''; my $opt = 303872; my $dpt = 70; # start the server by calling the REG TREE # it is using for this spell check session $obj->Start('SOFTWARE\abc spell\\' . $lang); # create the place holder for the suggestions # list returned by the Suggest() method below my $sugg = Variant(VT_BSTR|VT_BYREF, ""); # call the Suggest() method to get the suggestions # for the misspelled word, held in $word value! $obj->Suggest($word, $dpt, $lang, $dic, $opt, $sugg); print $sugg . "\n"; #### OLE DOCS... Variants by reference Some OLE servers expect parameters passed by reference so that they can be changed in the method call. This allows methods to easily return multiple values. There is preliminary support for this in the Win32::OLE::Variant module: my $x = Variant(VT_I4|VT_BYREF, 0); my $y = Variant(VT_I4|VT_BYREF, 0); $Corel->GetSize($x, $y); print "Size is $x by $y\n";