two questions:
1. the csv file
2. automating the process.
i'll answer 1 if you can either describe the format of the csv file or mail me a sample (justin DOT adie AT m-legal DOT net)
the 2nd is more in depth. in pseudo code you'd do the following:
1. create com word object
2. open word file
3. save word file as html file
4. close files.
5. open html file in php using fopen
6. suck in all the contents of the file
7. discard the contents you don't want (ie all the office header muck)
8. bung the remaining contents into a db using PHP (NOT PHPMYADMIN).
Code:
// user set variables
$hostname = "";
$user = "";
$password="";
$databasename="";
$table="";
// end var set
//nb $contents is the result of the html cleanup
mysql_pconnect($hostname, $user,$password)
or die("unable to connect to db server. ".mysql_error());
mysql_select_db($databasename)
or die (unable to connect to database. ".mysql_error());
$sql = "insert into $table
set contents = '"
.mysql_real_escape_string($contents)."'";
mysql_query($sql);
in office the tabs are converted to style declarations when saved as html files. internet explorer reads this natively. not sure about other browsers
Code:
<span style='mso-tab-count:2'></span>
if you have problems, you would then run all of this through a str_replace to replace the string with a classname and then set the indent in css.
but ... i have to ask ... why are you going through all this at all? does you office suddenly have a requirement to make all its word documents viewable as html or just viewable on the web? is this to make searching easier? I can't help thinking that the fundamental approach appears flawed but this is definitely a pre-judgement as i don't know WHY you want to do this. Perhaps we could help more or be more creative if you were to give us an explanation?
i'll post back on the csv when i get your sample file.
Justin