Location: PHPKode > scripts > MS Word And Excel > ms-word-and-excel/MsWord.Class.php
<?php
class MsCreator
{
 	var $File;
 	var $Text;
 	var $Type;
  	var $Download;

   function __construct()
   {
   	$this->File;
   	$this->Text;
   	$this->Type;
   	$this->Download;
    }

    function Download()
    {
    	//return CheckType();
    	if($this->Type == "Excel")
    	{
    	header("Content-type: application/vnd.ms-excel");
     	header("Content-Disposition: attachment;Filename=".$this->File.".Excel");
		}
     	else
     	{
     	header("Content-type: application/vnd.ms-word");
		header("Content-Disposition: attachment;Filename=".$this->File.".doc");
		}
     	echo "<html>";
		echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=print-1252\">";
		echo "<body>";
		print $this->Text;
		echo "</body>";
		echo "</html>";

    }
    function Preview()
    {
    	echo "<html>";
		echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=print-1252\">";
		echo "<body>";
		print $this->Text;
		echo "</body>";
		echo "</html>";
    }


}
?>
Return current item: MS Word And Excel