|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Currently, my system generates a HTML document based on the values passed and retrieves the contents of the documents from MySQL database.
Instead of HTML document, I want to generate an ms WORD document containing the same contents that the HTML document has. Can any of you give me some help or recommendations? So, i tried the code below..i pasted the whole thing just above the html code for the page I want to make into a WORD document. ---------------------------- $word = new COM("word.application") or die("Unable to start Ms Word"); $word->Visible = 0; //$contents will be the string you want to convert to a Word document $word->Documents->Add("$contents"); $word->Documents[1]->SaveAs("filename.doc"); $word->Quit(); $word->Release(); $word = null; ---------------------------- I tried the COM method but got this error: Fatal error: Cannot instantiate non-existent class: com in /home/all/www/www/php4/refer/profile1.php |
|
#2
|
|||
|
|||
|
do u have the com file to generate the doc file???
|
|
#3
|
|||
|
|||
|
Hey,
Sounds like you don't have COM support. Are you running the source or binary distribution of PHP? WHich version? and on Windows I assume. At this point the error isn't Word related, because PHP can't get past calling the COM function, which doesn't seem to exist. If you can tell us a bit more about your setup then we can go from there... thanks! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Problem in generating ms Word document |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|