(PHP 5, PHP 7)
COMPersistHelper::SaveToFile — Save object to file
TRUE]] ) : bool
Saves a copy of the object to the specified file.
filenameparameter is to be used as the current working file. If
filenamebecomes the current file and the object is supposed to clear its dirty flag after the save. If
FALSE, this save operation is a "Save A Copy As ..." operation. In this case, the current file is unchanged and the object is not supposed to clear its dirty flag.
TRUE on success or
FALSE on failure.
A com_exception is thrown if the associated object does not implement the COM interface IPersistFile, or when calling the IPersistFile::Save() method failed.
Example #1 Basic COMPersistHelper::saveToFile() Usage
$word = new COM('Word.Application');
$doc = $word->Documents->Add();
$ph = new COMPersistHelper($doc);