Dear All,
I am new to PHP and facing the problem of saving some reports in MS Word format.
The difficulty is there are header and footer required, so we cannot save it directly.
Is there sample or discussion about it? Thanks!
regards...
PHP: save report to MS Word document
Moderator: General Moderators
-
omega-systems
- Forum Newbie
- Posts: 14
- Joined: Tue Sep 27, 2005 5:01 am
- Contact:
Re: PHP: save report to MS Word document
Read more about COM in Php.
For instance for word:
Regards,
Michael.
Project Manager
Omega Systems Ltd
Email: info@omega-systems.biz
ICQ: 264962449
MSN: omega-systems@hotmail.com
AIM: OmegaSys Ltd
For instance for word:
Code: Select all
// starting word
$word = new COM("word.application") or die("Unable to instanciate Word");
print "Loaded Word, version {$word->Version}\n";
//bring it to front
$word->Visible = 1;
//open an empty document
$word->Documents->Add();
//do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");
//closing word
$word->Quit();
//free the object
$word->Release();
$word = null;Michael.
Project Manager
Omega Systems Ltd
Email: info@omega-systems.biz
ICQ: 264962449
MSN: omega-systems@hotmail.com
AIM: OmegaSys Ltd