RE: [PHP-WIN] VBA to Word - Syntax Question
| From: | alain samoun | Date: | Fri, 18 Jan 2002 21:51:09 +0000 |
| Subject: | RE: [PHP-WIN] VBA to Word - Syntax Question | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-11519@lists.php.net to get a copy of this message | ||
$word->ActiveDocument->Close(0);
A+
Alain
-----Original Message-----
From: news.php.net [mailto:letterj@phpgeek.com]
Sent: Thursday, January 17, 2002 7:43 AM
To: php-windows@lists.php.net
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: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net