I have found a tutorial on phpbuilder.com's site (http://www.phpbuilder.com/columns/yunus20031124.php3) for exporting data to a Microsoft document.
Here is the code:
<?php
$word = new COM("word.application") or die("Unable to instantiate Word");
$template_file = "C:/reminder.doc";
$word->Documents->Open($template_file);
$current_date = date("m/d/Y");
$bookmarkname = "TODAYDATE";
$objBookmark = $word->ActiveDocument->Bookmarks($bookmarkname);
$range = $objBookmark->Range;
$range->Text = $current_date;
$new_file = "c:/reminder_new.doc";
$word->Documents[1]->SaveAs($new_file);
$word->Quit();
$word->Release();
$word = null;
?>
But I am getting the following error:
Fatal error: Cannot instantiate non-existent class: com in .../export_to_word.php on line 2
I can't figure out what I'm doing wrong. Can anybody help me through this?
Thanks for your help in advance.