This is a discussion on PHP word doc within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I need only to open a world doc that is already exist in the server, using php ... plz I need ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I need only to open a world doc that is already exist in the server,
using php ... plz I need a simple answer to my question... I mean I have a word document " word.doc" saved in the server side and I need to open it by using PHP and post it back .. to the server ... I need a complete code plz Thank you in advance, :D ---------------------------------------- The post originated from PHP Freaks: ---------------------------------------- http://www.phpfreaks.com http://www.phpfreaks.com/forums |
|
|||
|
MAR wrote:
> I need only to open a world doc that is already exist in the server, > using php ... plz I need a simple answer to my question... > > > > I mean I have a word document " word.doc" saved in the > server side and I need to open it by using PHP and post it back .. to > the server ... I need a complete code plz > > > Thank you in advance, :D > > > > ---------------------------------------- > The post originated from PHP Freaks: > ---------------------------------------- > http://www.phpfreaks.com > http://www.phpfreaks.com/forums I don't know of any scripts or classes that can edit word docs, but it may be possible to create one. Taking a look at the source of some word docs, or maybe how OpenOffice opens them, might help. More "open" formats, like RTF, are easier to edit. |
|
|||
|
Brendan Donahue wrote:
> MAR wrote: > >> I need only to open a world doc that is already exist in the server, >> using php ... plz I need a simple answer to my question... >> >> >> >> I mean I have a word document " word.doc" saved in the >> server side and I need to open it by using PHP and post it back .. to >> the server ... I need a complete code plz >> >> >> Thank you in advance, :D >> >> >> >> ---------------------------------------- >> The post originated from PHP Freaks: >> ---------------------------------------- >> http://www.phpfreaks.com >> http://www.phpfreaks.com/forums > I don't know of any scripts or classes that can edit word docs, but it may > be possible to create one. Taking a look at the source of some word docs, > or maybe how OpenOffice opens them, might help. More "open" formats, like > RTF, are easier to edit. I was talking about creating on online editor there, but maybe you just need the user to download the file, edit it in MS Word and upload it? That would be much easier. |
|
|||
|
"Brendan Donahue" <wizard@wizardsofwebsites.com> a écrit dans le message de news:0NudnTjc9axEyBvd4p2dnA@comcast.com... <snip> > > http://www.phpfreaks.com/forums > I don't know of any scripts or classes that can edit word docs, but it may > be possible to create one. Taking a look at the source of some word docs, > or maybe how OpenOffice opens them, might help. More "open" formats, like > RTF, are easier to edit. Creating DOC files is a nightmare because it relies on the version of Word. Creating RTF files is much easier even though the RTF format is a pain to read. Personnaly, I use RTF Generator, a PHP proggy. It's simple and fast. I just create html-like document and off you go. More info & online demo here: http://www.paggard.com/projects/rtf.generator/ -- Choowie |
|
|||
|
Brendan,
If I understand you correctly, you want to open and edit a word document using PHP. If so, this can be done using COM in PHP. To open and, say, add some text to an exisitng word doc and save it as something else, you may go: ********************* <?php word=new COM("Word.Application") or die("Cannot start word"); word->Visible=true ; // If you want to see it (false if not) word->Documents->Open(../full path and filename to word doc here/..); word->ActiveDocument->Typetext("A bit of extra text"); word->ActiveDocument->SaveAs(../full path & filename to new doc here/..); word->Documents->Close(); word->Quit(); //Free the object word->Release(); ?> ************************ I have used this technique successfully, but I have found it difficult to locate a comprehensive reference guide to the commands available. I've just basically picked the eye's out of other examples...(if anyone has one, please let me know..) A simple example of this is located here: http://www.developerfusion.com/show/1753/ And here is a full on Mailmerge example to show the extent of what you can actually do in MS word from PHP: http://www.zend.com/tips/tips.php?id=262&single=1 PS. I agree with Choowie - RTF or PDF is a much better way to go if you can, but alas we don't always have a choice..!! ---------------------------------------- The post originated from PHP Freaks: ---------------------------------------- http://www.phpfreaks.com http://www.phpfreaks.com/forums |