I sent this to the php.windows group as well, but haven't heard an answer,
so I'm "escalating" it to the general list. Please don't be offended by the
redundant posting. I've scoured the web for an answer, but virtually all COM
examples using Word are copies of the code in the PHP manual.

I'm just looking for the PHP syntax for a specific COM call. I have the VBA
code I'm trying to base it on included below. The answer is probably
blatantly obvious, but I  don't see it. I'm just using the quit() to close
it and having to hit "no" every
time.

I'm working on a simple PHP spell check that uses Word as its engine. The
whole thing works, but I want to close the temp document without being
prompted to save. The VBA to do this according to several VBA sites is:
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
I'm looking for the PHP syntax to do this.


function spellcheck($string){
$word = new COM("word.application") or die("The spellcheck function requires
MS Word.");
$word->Visible = 0;
$word->Documents->Add();
$word->Selection->TypeText($string);
$word->ActiveDocument->CheckSpelling();
$word->Selection->WholeStory();
$corrected = $word->Selection->Text;
//the VBA sample code ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
$word->Quit();
$word->Release();
$word = null;
return $corrected;
}


J Wynia
phpgeek.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to