Hello Guys,
I am working on an applications that needs certain data fetched from database and saved as an MS Word document. Can someone please give me directions on how to save as MS Word or RTF format ?
Thanks,
Curious
Saving to MS Word Format
Moderator: General Moderators
For starters you need to be on a windows server becuase you need to use the COM functions/
Here is how you wold write a word document
Mark
Here is how you wold write a word document
Code: Select all
<?
$word=new COM("word.application") or die("Cannot start MS Word");
print "Loaded word version ($word->Version)\n";
$word->visible = 1 ;
$word->Documents->Add();
$word->Selection->Typetext("This is a test");
$word->Documents[1]->SaveAs("E:\\test_doc.doc",8);
$word->Quit();
$word->Release();
$word = null;
?>