User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 392,075 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,082 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 6604 | Replies: 4
Reply
Join Date: Sep 2006
Posts: 12
Reputation: fernandodonster is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
fernandodonster fernandodonster is offline Offline
Newbie Poster

Help How we open a ms word document file with php?

  #1  
Sep 30th, 2006
How we open a ms word document file with php?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation: Puckdropper is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 20
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: How we open a ms word document file with php?

  #2  
Sep 30th, 2006
It depends on what you want to do. You can pass the request to the system (only works for specific systems) or you can perhaps find a library that will allow you to do it.

AFAIK, only text files can be opened without special manipulation in most programming languages. (Database access does not count.)
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote  
Join Date: Sep 2006
Posts: 12
Reputation: fernandodonster is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
fernandodonster fernandodonster is offline Offline
Newbie Poster

Re: How we open a ms word document file with php?

  #3  
Sep 30th, 2006
Thanks
Reply With Quote  
Join Date: Jun 2007
Posts: 71
Reputation: Pro2000 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Pro2000's Avatar
Pro2000 Pro2000 is offline Offline
Junior Poster in Training

Solution Re: How we open a ms word document file with php?

  #4  
Aug 15th, 2007
Originally Posted by Puckdropper View Post
It depends on what you want to do. You can pass the request to the system (only works for specific systems) or you can perhaps find a library that will allow you to do it.

AFAIK, only text files can be opened without special manipulation in most programming languages. (Database access does not count.)


you can open an ms word document with its coordinations,How?OK Look:
to make a coordination you must use this:
$opened_file=file("THE FILE PATH")
$old_array=array('[b]','[u]','[i]');
$new_array=array('<b>','<u>','<i>');
$string=str_replace($old_array,$new_array,$opened_file);
To open a file use this:
The great scientist see his web-site:
http://www.elnaggarzr.com/en
I'm sure that will be good for you!
Reply With Quote  
Join Date: Nov 2006
Posts: 8
Reputation: Draicone is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Draicone Draicone is offline Offline
Newbie Poster

Re: How we open a ms word document file with php?

  #5  
Mar 15th, 2008
Puckdropper is right, none of these code samples will actually work, as MS Word uses a binary file format, and might even refuse to open a file that had been modified with random bbcode/html added on the end. If you try very basic examples it will work, however MS Word creates all sorts of problems in the background using Word 97-2003 files. .docx files will fail entirely because of the zip file format.

What you really need to do is use COM to tell MS Word itself to handle parsing the file. You can create a new COM object with $word = new COM("word.application"); which basically opens up a copy of MS Word on the server and gives you access to it from PHP.

Take a look at this blog post on opening microsoft word files in php and extracting text. Naturally you need a Windows based server in order to do this.
Last edited by Draicone : Mar 15th, 2008 at 7:18 am. Reason: Update
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 12:13 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC