Gast Posted July 17, 2006 Share Posted July 17, 2006 Does anyone know if it is possible? I understand you need the COM extension on a Microsoft Server, but is there a way to get it to work on a Linux system?Also, can't you just use fwrite()? I have made an Excel document using only PHP's functions so maybe it is possible with Word? Quote Link to comment https://forums.phpfreaks.com/topic/14885-writing-to-ms-word-with-php-on-linux/ Share on other sites More sharing options...
hitman6003 Posted July 18, 2006 Share Posted July 18, 2006 You probably did not create a true excel file...probably a csv that excel opened and was able to manipulate. I don't think it's possible to create a true MS word file without using COM. You can write .txt and I think .rtf files in straight text which word will manipulate. The rtf (rich text format, which is what wordpad produces) MS Word will work with, and you can apply formatting to the text...bold, italic, and such. Quote Link to comment https://forums.phpfreaks.com/topic/14885-writing-to-ms-word-with-php-on-linux/#findComment-59720 Share on other sites More sharing options...
Gast Posted July 19, 2006 Author Share Posted July 19, 2006 [quote author=hitman6003 link=topic=100925.msg399003#msg399003 date=1153184292]You probably did not create a true excel file...probably a csv that excel opened and was able to manipulate. I don't think it's possible to create a true MS word file without using COM. You can write .txt and I think .rtf files in straight text which word will manipulate. The rtf (rich text format, which is what wordpad produces) MS Word will work with, and you can apply formatting to the text...bold, italic, and such.[/quote]I might have to go with the RTF option as a customer wants basically to be able to get a script to generate letters that he can "mail merge" in Word.Also, about the Excel file, it wasn't a CSV file, it was an XLS file. Basically if you write to one using fwrite() etc, you can use the tab character "\t" to move to each cell. I will post the script when I find it in a minute out of interest. Quote Link to comment https://forums.phpfreaks.com/topic/14885-writing-to-ms-word-with-php-on-linux/#findComment-60602 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.