Thanks Andrew,
I will give your code a shot. I was hoping to ask you one more easier question. I want to the users to be able to create a title for my HTML but I'm having trouble setting it up. I thought it would be as easy as:
htmlTitle = gp.GetParameterAsText(0)
outfile.write(htmlTitle)
Then when I add the script to a model or a toolbox and run from ArcMap
I right click the script > go to Parameters tab > and set the DataType to string (for the htmlTitle parameter) and I set type to required, Direction to Input, Multi to No, Filter to none, all the rest I leave blank.
In arcmap everything is fine and the user has a text box to enter the name of title, but in server I don't see that text box. So how do I make that text box appear in Server.
Thanks
David