PHP and COM - Syntax question

From: Date: Fri, 18 Jan 2002 16:27:02 +0000
Subject: PHP and COM - Syntax question
Groups: php.general 
Request: Send a blank email to php-general+get-81107@lists.php.net to get a copy of this message
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

« previous php.general (#81107) next »