Question

Converting word document to html

Asked by: horalia

I will be publishing several word documents on a web site, is there a quick way to quickly convert the documents to .html without all the extra headers tha word places?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-02-27 at 09:25:56ID22416473
Topic

Microsoft Word

Participating Experts
3
Points
500
Comments
20

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Publisher question
    Is there a way to import an HTML document, that was previously converted from Publisher, back into Publisher? Due to a disaster, I've lost the original publisher file that the page was converted to HTML from. Cheers, Russ.
  2. wiki with html publishing option
    Is there a wiki application that has a "publish" option that would create a bunch of html files that captures the current state of the wiki? I would like to use a wiki on my computer, and then have the option of converting the current state of the wiki to a bunch o...
  3. I need to convert dataset to html...quickly???
    I need to convert data inside a dataset dynamically, hopefully using the WriteXml method, then converting in 1 line of code to html....can this be done??? I am expecting to be able to do something like document.XmlToHtml(); Is there already some functionality microsoft has t...
  4. Convert Publisher 2003 pages to Frontpage
    Is there a easy way to convert pages created in Publisher to HTML so that i can use in Frontpage ?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: b0lsc0ttPosted on 2007-02-27 at 10:05:48ID: 18619028

What type of text formatting do you have?  What is your knowledge of html and can you use a server language?  If so, which?  If the content of the file is mainly used as the body of the page and formatting, etc don't need to be converted then save I would suggest saving the file as a text file.  If you can use a server language then you can even have it read the text file and create the html page using server script.

Does the document need to be an html page?  The reason I ask is I would usually recommend creating a PDF document of the DOC file before having Word create an html file.

You seem to already be aware of this but Word does not make good web pages and I would never use it as a web page editor (creator).  However if you have documents that need to go on the web, which seems to be the case here, then there are some better options than Word creating the page.  Let me know what you think of the suggestions above.  Let me know if you have any questions or need more information to answer any of my questions.

bol

 

by: horaliaPosted on 2007-02-27 at 10:13:20ID: 18619077

Thanks bol. I already converted the word document to a simple text file and now I'm adding html tags to format it. Of course, I'm taking some time doing this but I've been told that I'll be adding only very few documents, maybe 5 in total, so I'll just do this manually. I ended up saving the page as php, because I would like for this document to appear inside the main body of the site, so I needed to include the index page from that section. Anyways, I'm still stuck, maybe you can help me. How can I apply styles to just these documents? Do I create a <div> tag? I'm a little lost, because I've formatted tables, but never documents. Thanks for your quick response!

 

by: AntonioPPosted on 2007-02-27 at 10:14:09ID: 18619089

As bol said, there is no way to make Word create a clean HTML file.  However, if you just need a quick-and-dirty HTML file, you can reduce the amount of Word-specific garbage in the file by saving it as a "filtered" web page.  Word will pop up a warning saying that the Filtered page removes a lot of Word tags and that you won't be able to open the HTML file in Word later and have it look just like the Doc file did.

I've used this in the past, and it can cut the file size in half or better.  But it's still nowhere near "clean" html.

 

by: b0lsc0ttPosted on 2007-02-27 at 10:29:37ID: 18619200

I was not aware of the setting AntonioP mentioned and if you need some of the word formatting it may be better than a text file.  However if all of the document will be formatted the same then I would stick with text file, unless MS really creates good html with that option.

Without an example or more specifics I don't know if div tags are the magic answer but they are certainly used to format text.  Let me get some more information about the document and its contents.

Are there multiple paragraphs?  Do you have different styles?  Are the contents included as one or do they go in different places on the page?

Making the file manually may be more work than you need to do.  If you already have a web page framework that you are "fitting" the document in then it may help to see the html for it or at least an outline.  If you are trying to fit "content" (i.e. the document) inan existing page (i.e. format) then most likely AntonioP's suggestion of the filtered web page won't be easier.  Word won't know the format you want.  However PHP, or other server languages, could read this text file and make the page.  You would not need to manually create the page nor need Word to make even a basic html page.

Let me know which option you want to try or if you have questions.  If you want me to help then please provide some information and/or code/examples so I can.

bol

 

by: horaliaPosted on 2007-02-27 at 11:18:00ID: 18619580

Fortunately, the its not a big file, just a one page document containing emergency procedures. I can post the file for you guys to look at it, just let me know where to go. I did this once, but I can't remember how!

 

by: b0lsc0ttPosted on 2007-02-27 at 12:06:42ID: 18619931

You can post it at www.ee-stuff.com.  It is for EE members to use and will let you post certain files.  If you do then paste the URL here or let us know the file is posted so we will know to check.

bol

 

by: b0lsc0ttPosted on 2007-02-27 at 12:07:45ID: 18619939

If you are talking about just the Word doc that alone would not give us an idea of the other questions I asked.  Just keep that in mind as you provide information.

bol

 

by: horaliaPosted on 2007-02-27 at 13:40:11ID: 18620719

Sorry, I went out to lunch. Let me post the file and I'll answer the rest of your questions, bol.

 

by: horaliaPosted on 2007-02-27 at 13:49:49ID: 18620786

For some reason, ee-stuff didn't allow me to upload the file, I'll just describe it for you.

1. The document contains procedures to be followed in case of an emergency. It has three main sections: Procedure, Additional Notes, and Phone Numbers.
2. Procedure has 9 sentences in a list.
3. Additional Notes has two sentences, also in a list.
4. Phone Numbers contains the numbers in a table. The table consists of 5 columns and 7 rows.
5. The end of the document contains the last date that it was updated.

That's practically it with the file, as you can see, the document is pretty small, contains only 409 words, 24 paragraphs and 40 lines.

Existing styling
I already have styling in place, for which I'm using Cascading Style Sheet, that why I need to find a way to apply stying only to the document mentioned above. I tried <div>, but the lists were being placed to the far left of the page, hiding the bullet.

Please let me know if this answers your questions. Thansk!

 

by: horaliaPosted on 2007-02-27 at 13:50:54ID: 18620795

I have no problem with the type of format that is applied, I can change it later. Thanks!

 

by: GrahamSkanPosted on 2007-02-27 at 15:27:42ID: 18621528

There are certain extensions, including .doc, that ee-stuff won't allow.  If you can't zip it, just changing the extension is enough.

 

by: horaliaPosted on 2007-02-27 at 15:29:35ID: 18621547

Thanks! I converted the document into .txt, but it still gave me issues. I have posted other files though, so it must be the extension.

 

by: b0lsc0ttPosted on 2007-02-27 at 16:11:55ID: 18621747

If the file will always follow that format I would make a test file, read the text file using PHP script into variables, then make the page and insert the variables where you want them.  Do you have html for a page that we can use as a guide?  If not, I can make an example with a basic html page.

It would be most helpful if you could paste a sample (change the contents to protect information) of the text file.  This will show me how the information is separated, where the new lines are, and what other characters may be used.  It can also show how the phone numbers and the date appear.  If you do post this sample make sure you change the phone numbers at the very least. :)

bol

 

by: horaliaPosted on 2007-02-28 at 09:47:02ID: 18627066

OK, thanks bol, I'll post the content right away. I don't think the page will change very often, only the phone numbers at the very least, so something simple just to post this info in the site would be good. I'm adding the tags to the file, the only problem that I'm currently having is that the bullets don't appear correctly in the page, it seems like they too far right. Here's the content:

EMERGENCY CTP BACKUP PROCEDURE
In the event that both Reno CTP imagers fail, we will take the following steps:
Procedure
•      The Prepress supervisor will call the Production manager.  (if there is no Prepress supervisor on duty at the time, the Prepress paginator will call both Prepress supervisors)
•      The Production manager will call the Production Director, the ESP General manager, and the Press Manager to alert them that we need to go to plate backup in Carson.
•      The ESP General manager will call one of the ESP production staff to go to the ESP facility.  They will immediately check equipment status and load Reno plates in the Agfa Advantage CL.
•      The Prepress supervisor will verify that pages in Arkitex/Director are correctly set with the Carson—backup event sequence turned on.
•      The ESP General manager and the Production manager will go directly to the ESP facility to verify that the Agfa Advantage CL is turned on and that plates are imaging correctly.
•      The Prepress supervisor on duty will approve and release ready pages to the Agfa imager at the ESP facility.  
•      If the Production Manager deems it necessary, the Prepress supervisor who is off at the time of the incident will be notified and asked to help transport plates from ESP to Reno.
•      When the majority of the plates needed have been output, the Production manager will return to Reno, where a Prepress staff member will run them through the Nela Bender.
•      When the last of the plates have been output, the ESP General manager will return the remaining plates to Reno to be bent and punched.

Additional notes
•      The ESP General manager will be responsible for keeping an adequate supply of Reno size plates on hand at all times.
•      In the event the Production manager is out of town or unavailable, the Prepress supervisor who is off at the time of the incident will be notified and together, the supervisors will coordinate and assure the backup procedure is followed.
 
Phone numbers to call:

Production Director      Me      work 123-4567      cell 123-4567
Production Manager      Him      work 123-4567      cell 123-4567
Prepress Day Supervisor      Her      work 123-4567      cell 123-4567

 

by: b0lsc0ttPosted on 2007-03-06 at 09:10:11ID: 18663402

Sorry it took me a little time to respond.  I hope this still helps.  Thanks for the reply and the details you have provided.

I wrote some PHP script that will do this.  It can be modified and I just used a file (in the same folder) named read_file.txt.  The method I used to do this assumes that some of the "title" lines (e.g. Procedure, Additional notes, and Phone numbers to call:) will always be exactly the same.  Let me know if that isn't the case.  The phone numbers could be placed in a table or handled differently depending on how you want them to look.  I had to add some code to handle some of the symbols that were used in the file so the browser would display them correctly.  This script will definitely show you how to do what we have discussed but you can still change the specifics to get the page you want.  Let me know if you have a question or need more info.

<?php
// 149 is the li

function convertChr($string) {  // function makes up for chr missed by htmlentities (>127)
      $arTrans = array();
      for ($i=127; $i<255; $i++) {
            $arTrans[chr($i)] = "&#" . $i . ";";
      }
      $fixedString = strtr($string, $arTrans);
      return $fixedString;
}
function convertLI($string) {
      $strLI = "<li>" . preg_replace("'&#149;'", "", $string) . "</li>";
      return $strLI;
}

$lines = file("read_file.txt");
foreach ($lines as $line) {
      $line = convertChr($line);
      if ($line == "Procedure\r\n") {
            $licount = 0;
            echo $line . "<ul>";
      } elseif ($line == "Additional notes\r\n") {
            $licount2 = 0;
            echo $line . "<ul>";
      } elseif (isset($licount)) {
            if ($licount < 9) {
                  echo convertLI($line);
                  $licount += 1;
            } else {
                  echo "</ul>" . $line;
                  unset($licount);
            }
      } elseif (isset($licount2)) {
            if ($licount2 < 2) {
                  echo convertLI($line);
                  $licount2 += 1;
            } else {
                  echo "</ul>" . $line;
                  unset($licount2);
            }
      } elseif ($line == "Phone numbers to call:\r\n") {
            $licount3 = 0;
            echo $line . "<br />";
      } elseif (isset($licount3)) {
            if ($licount3 < 3) {
                  echo "<div style=\"white-space: pre;\">" . $line . "</div>";
                  $licount3 += 1;
            } else {
                  echo "<div style=\"white-space: pre;\">" . $line . "</div>";
                  unset($licount3);
            }
      } else {
            echo $line . "<br /><br />";
      }
}
?>

 

by: horaliaPosted on 2007-03-07 at 09:30:29ID: 18671999

Thanks bol. I just came back from vacation, I'll take a look at the code and try it out. Thanks again!

 

by: b0lsc0ttPosted on 2007-03-07 at 09:43:29ID: 18672117

Your welcome!  I hope you had fun and I'm glad the delay on my part didn't matter.  Let me know if you have a question or need information.

bol

 

by: horaliaPosted on 2007-03-08 at 09:59:58ID: 18681043

Works great! Thanks!

 

by: b0lsc0ttPosted on 2007-03-08 at 10:03:34ID: 18681070

Good.  Your welcome!  I'm glad that helped.  Thanks for the grade, the points and the fun question.

bol

 

by: horaliaPosted on 2007-03-08 at 10:09:10ID: 18681121

No problem, hope to see you soon in another question!

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...