none
Formatting Word Doc to HTML RRS feed

  • Question

  • Hello,

    I am attempting to devise a way to take a word document and format it into lean HTML before copying to a Clipboard; hoping to also streamline this into a macro or script to simplify it for end users.  This is in an attempt to standardize a control so that formatting does not continue to cause a web application (third party) multiple formatting issues that is plain ugly.

    If I attempt to do the Save As > Web Page | Open with browser and view code | the HTML is quite awful.  I have read many forums stating that Word has a way of adding unnecessary [inline styles to every paragraph that differ from what is needed] markup.

    Using Notepad++ is another way to export to HTML but not really an acceptable end user solution.

    I have found a few online editors that usually take care of the formatting, but lack font control - something else I am looking to get.

    Any recommendations or feedback is greatly appreciated!



    • Edited by cwesterm1 Wednesday, August 20, 2014 6:51 PM
    Wednesday, August 20, 2014 6:50 PM

Answers

  • Hi Cwesterm,

    >>If I attempt to do the Save As > Web Page | Open with browser and view code | the HTML is quite awful.  I have read many forums stating that Word has a way of adding unnecessary [inline styles to every paragraph that differ from what is needed] markup.<<

    As far as I know, we can save the Word document in filtered HTML, so that the tags used by Microsoft Office programs are removed.( refer to About using filtered HTML).

    And here is the code to save a document in filtered HTML for your reference:

    Sub saveAsHTML()
    ActiveDocument.SaveAs2 "HelloWord.html", wdFormatFilteredHTML
    End Sub

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, August 21, 2014 7:51 AM
    Moderator

All replies

  • Hi Cwesterm,

    >>If I attempt to do the Save As > Web Page | Open with browser and view code | the HTML is quite awful.  I have read many forums stating that Word has a way of adding unnecessary [inline styles to every paragraph that differ from what is needed] markup.<<

    As far as I know, we can save the Word document in filtered HTML, so that the tags used by Microsoft Office programs are removed.( refer to About using filtered HTML).

    And here is the code to save a document in filtered HTML for your reference:

    Sub saveAsHTML()
    ActiveDocument.SaveAs2 "HelloWord.html", wdFormatFilteredHTML
    End Sub

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, August 21, 2014 7:51 AM
    Moderator
  • Bottom line: Word is a Word processor, not a web development app. If you're developing web pages, use the proper tools, such as: http://www.microsoft.com/web/platform/tools.aspx

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Thursday, August 21, 2014 9:48 AM
  • I'm sorry, not very sure that this answer is helpful.  Bottom line - if you would read (and I do hope that is possible), you would see that I clearly stated this is for end users.  End users are not developers.  Please stay away from my forum's in the future.

    Thank you!

    Thursday, August 21, 2014 12:12 PM
  • Thank you Fei, greatly appreciated!

    I will look into this macro. 

    Thursday, August 21, 2014 12:13 PM
  • if you would read (and I do hope that is possible), you would see that I clearly stated this is for end users.  End users are not developers.  Please stay away from my forum's in the future.

    Such a rude and hostile response is totally uncalled for. Word is NOT a web design tool. If you want your end users to do web design, provide them the appropriate tools. There are plenty of such tools out there that are suitable for use by end users, including from MS in the link I provided.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Friday, August 22, 2014 3:06 AM
  • CAPS are uncalled for; also, you only prove me right from my "rude and hostile response" because you still missed the last sentence.
    Friday, August 22, 2014 4:55 PM