PHP word doc

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-21-2004
MAR
 
Posts: n/a
Default PHP word doc

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


Reply With Quote
  #2 (permalink)  
Old 04-21-2004
Brendan Donahue
 
Posts: n/a
Default Re: PHP word doc

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.
Reply With Quote
  #3 (permalink)  
Old 04-21-2004
Brendan Donahue
 
Posts: n/a
Default Re: PHP word doc

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.
Reply With Quote
  #4 (permalink)  
Old 04-21-2004
choowie
 
Posts: n/a
Default Re: PHP word doc


"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

Reply With Quote
  #5 (permalink)  
Old 04-28-2004
MartyInOz
 
Posts: n/a
Default Re: PHP word doc

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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:43 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0