and I taught it's the version of word on my localhost or my OS so I tried them on with different windows OS and MS word. but same result, since it would be harder to make it work on remote server (the remote server needs to have MS word installed on) so I'm looking for different approach, what you think?? is there nay good one rather than COM applications? have you ever tried? is it possible to write code with other like ASP or java and combine it with PHP? every little piece of advice would be appropriated, thanks
what's the best approach for reading and writing MS word doc
Moderator: General Moderators
what's the best approach for reading and writing MS word doc
I'm trying to process MS words doc in PHP. I found some samples which use COM applications for this but not working properly (I get only exceptions and no result)
and I taught it's the version of word on my localhost or my OS so I tried them on with different windows OS and MS word. but same result, since it would be harder to make it work on remote server (the remote server needs to have MS word installed on) so I'm looking for different approach, what you think?? is there nay good one rather than COM applications? have you ever tried? is it possible to write code with other like ASP or java and combine it with PHP? every little piece of advice would be appropriated, thanks
and I taught it's the version of word on my localhost or my OS so I tried them on with different windows OS and MS word. but same result, since it would be harder to make it work on remote server (the remote server needs to have MS word installed on) so I'm looking for different approach, what you think?? is there nay good one rather than COM applications? have you ever tried? is it possible to write code with other like ASP or java and combine it with PHP? every little piece of advice would be appropriated, thanks
-
thecodewall
- Forum Commoner
- Posts: 33
- Joined: Sun Dec 26, 2010 8:37 am
Re: what's the best approach for reading and writing MS word
I think this may help.
It will generate word document.
source: http://thecodewall.blogspot.com/2010/12 ... n-php.html
Code: Select all
<?php
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=document_name.doc");
?>
<html>
<head>
<title>Creating word document in PHP</title>
</head>
<body>
hello world
</body>
</html>
source: http://thecodewall.blogspot.com/2010/12 ... n-php.html
Re: what's the best approach for reading and writing MS word
don't forget:
Code: Select all
header("Content-Length: ".filesize($filepath.$filename));