$word->ActiveDocument->Close(0); A+ Alain -----Original Message----- From: news.php.net [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 17, 2002 7:43 AM To: [EMAIL PROTECTED] Subject: [PHP-WIN] VBA to Word - Syntax Question
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. Here's the whole function with the test print statement at the end. The final version will just pass back the checked string. 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; //the VBA sample code ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges $word->ActiveDocument->Close(); $word->Quit(); $word->Release(); $word = null; print($corrected); } -- PHP Windows 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] -- PHP Windows 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]