Jump to content

Converting .doc to php..... tearing my hair out!


ex gratia

Recommended Posts

Someone has sent me about 50 file written and saved in word as .doc files.

They want me to put them onto their php website as modules.

I have tried to download a doc to html converter and then convert the html to php but microsoft add so much GARBAGE to the doc file that it spits out errors.

I just want a simple way of uplaoding their .doc files to the modules folder and have it show up correct with right hand blocks etc....

help?  pleaseeeeeeeeeeee??? :-[
Link to comment
Share on other sites

What ever way you look at it.
You have to do something to all files. Convert to Plain Text, not Rich text.
Copy and Pasting everything somewhere.

If it is just text, I think PHP can read the text from Word Docs.
If the files are named
doc01
doc02

just run a loop
for($i = 1; $i <= 50; $i ++){
Code for Grabbing text, and spitting it into a php file

}
Link to comment
Share on other sites

No converting them to .txt file removes ALL formatting.. which means I would have to go through and format it again... I may as well do that to the word file and then cut and paste into an index.php file for each module but it is taking AGES... and with 50 .doc files I could be here all month...

Why does microsoft fill the files with so much crud??

I just want a basic html file with basic formatting not all the junk...  *kicks Bill Gates**
Link to comment
Share on other sites

The guy added images to the files too and refuses to formet the files saying he hasnt time....

I asked him to do the basic <br> <img src=> etc etc... too much effort for him and now Im left with a doc file that i would either have to manually format or convert to word html and then remove all the junk...

Link to comment
Share on other sites

Demoronizer - http://www.fourmilab.ch/webtools/demoroniser/ - might do the trick

or download Microsoft's filter software - http://www.microsoft.com/downloads/details.aspx?FamilyID=209ADBEE-3FBD-482C-83B0-96FB79B74DED&displaylang=EN

details on that - http://office.microsoft.com/en-us/assistance/HA010548651033.aspx

And most importantly, send the idiot a HUGE invoice.
Link to comment
Share on other sites

Alas while the demoroniser worked it didn't keep the formatting for the images and still didnt remove the microsoft rubbish so trying to find where the images are is taking as much time as me sitting here and reformatting it by hand... grrrrrr....

Thank you all anyway!
Link to comment
Share on other sites

Well after what seems hours of faffing about I eventually loaded each file and images in their own folder and have them as htm files... it looks shoddy and not in keeping with the rest of the phpnuke site but I will go through them all one by one when i am less... vexed!

The PDF didn't work I kept getting errors that because the files had been sent as attachments they were not decoded.

I need a rather large wall to beat my rather sore head against...

WHY cant people learn simple formatting?? I sent him a simply sheet with basic formatting on it telling him that by the time he has highlighted text and clicked on bold he may as well type < b > around it.

he said it was too difficult to understand.

I wont be doing any more work for him unless he starts formatting.... this is NOT fun!

::) >:(
Link to comment
Share on other sites

YES YES YES!!!!

OK heres what i did....

created a modules folder in the phpnuke,
threw all the junk for that module in there... including the htm file
created an index file and added the following coding... spent the last 30 minutes tweaking it about but it works...

[code]<?php
if (!eregi("modules.php", $PHP_SELF)) {
  die ("You can't access this file directly...");
}
$index = 1;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
include("header.php");
OpenTable();
include("modules/Antiage/Antiage.htm");
CloseTable();
include("footer.php");
?>[/code]

My only p[roblem now is the fact it isnt finding the images but rather leaving RED EX spaces... so I'll HAVE to faff about inside the microsoft coding and find where they are mentioned and img src them all...

But I did it!!!  kind of!

Yay to blondes!  lol
Link to comment
Share on other sites

All files done and dusted and the site looks fab!!

Downloaded arather nifty tool called:

PHP designer 2006

It was simpley the best to find the images and I had all 47 files re formatted and included in the phpnuke site in no time.. not sure what else the PHP designer does but it looks fab!

Thank you for all your help guys...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.