Re: PHP and COM - Syntax question
| From: | J Wynia | Date: | Fri, 18 Jan 2002 19:48:00 +0000 |
| Subject: | Re: PHP and COM - Syntax question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81142@lists.php.net to get a copy of this message | ||
Figured it out. Pulled out the ->Close() and had the quit() just override
the save. Here's the new function in case anyone cares.
function spellcheck($string){
$word = new COM("word.application") or die("Unable to instanciate Word");
$word->Visible = 0;
$word->Documents->Add();
$word->Selection->TypeText($string);
$word->ActiveDocument->CheckSpelling();
$word->Selection->WholeStory();
$corrected = $word->Selection->Text;
$word->Quit(false);
$word->Release();
$word = null;
return $corrected;
}
J Wynia
phpgeek.com