Jump to content

.com to word problem


web2000

Recommended Posts

Hello,

 

I am using the COM function to export data from PHP to Word.

 

It works perfectly but the problem i have is that when the files are hosted on a local web server the file opens on the local web server rather than the client machine. Does anyone know how to do this on the client machine?

 

Thanks, here is the code

 

$word = new COM("word.application") or die("Unable to instantiate Word");
$template_file = "C:/letter.doc";
$word->Documents->Open($template_file);
$current_date = date("d/m/Y");
$bookmarkname = "TODAYDATE";
$objBookmark = $word->ActiveDocument->Bookmarks($bookmarkname);
$range1 = $objBookmark->Range;
$range1->Text = $current_date;
$word->visible = 1;

Link to comment
https://forums.phpfreaks.com/topic/50910-com-to-word-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.