is it possible to write in word file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jigaruu
Forum Newbie
Posts: 21
Joined: Wed Feb 18, 2004 11:46 pm
Contact:

is it possible to write in word file

Post by jigaruu »

I need to know that is it possible to write in the word file instead of txt file, if it is a .rtf file it will do if its possible to write in it, i searched a lot, but no success, so plz help me out

thanks in advance.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

You can using the COM objects.

Only works on windows servers though.

Mark
User avatar
Dr Evil
Forum Contributor
Posts: 184
Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland

Post by Dr Evil »

Well with PHP you can easily output text as you know.
word is not the best choice as it is MS technology. RTF on the otherhand can be read by all. RTF is basically a text file with certain specific tags.
Google will help you with this:
http://www.google.com/search?sourceid=n ... cification

Why not try making a template in word, save it in rtf format, open it with a text editor (ultra edit or such) and look throught the jumble till you find the chunks that interest you.
You'll have to specify the correct header so that the php file is donloaded as rtf.

Hope this helps a bit.
jigaruu
Forum Newbie
Posts: 21
Joined: Wed Feb 18, 2004 11:46 pm
Contact:

Post by jigaruu »

i tried, downloading is possible, and it also opens for editing but the writing is what creating problems, no error message is generated and everything is going on fine, but file is not written or saved.

and also the word format is requested by client so we cannot change the sane, but still if its possible in .rtf format then it can be managed,
User avatar
Dr Evil
Forum Contributor
Posts: 184
Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland

Post by Dr Evil »

jigaruu wrote:still if its possible in .rtf format then it can be managed,
That is exactly what I'm talking about.

Do you know how to create txt files on the server with php ?
jigaruu
Forum Newbie
Posts: 21
Joined: Wed Feb 18, 2004 11:46 pm
Contact:

Post by jigaruu »

ya i am trying so get back to this as i am done, but it will take time as i am off ofr the day, so talk to you tomorow
User avatar
Dr Evil
Forum Contributor
Posts: 184
Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland

Post by Dr Evil »

Ok see ya, take care.
jigaruu
Forum Newbie
Posts: 21
Joined: Wed Feb 18, 2004 11:46 pm
Contact:

Post by jigaruu »

hey i am back and, can u help me i got how to write in text file and save it but same is not working with rtf file.
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Post by Steveo31 »

Wonder if this could be of any help?

http://www.phpbuilder.com/columns/yunus20031124.php3
User avatar
Dr Evil
Forum Contributor
Posts: 184
Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland

Post by Dr Evil »

jigaruu wrote:hey i am back and, can u help me i got how to write in text file and save it but same is not working with rtf file.
Show me your code
Post Reply