Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using CSS in WORD created HTM file (WORD 2000/2003)

    Hi

    I am not sure if this is the correct forum but wasn't sure where to pitch this so here goes.

    Does anybody know how to get WORD to use a CSS file when saving the document as a HTM.? I have followed the directions provided by Microsoft in the knowledgebase but to no avail.

    The background:
    I have to produce two sets of documents - standard printed manuals and HTML outputs for the website. I am using a single source for this and save the documents in two separate formats (.doc and .htm). Unfortunately, I have inherited lots of documents with callouts. I could use something like Robohelp but it doesn't work at all with callouts etc plus there would be 70 odd documents to import in Robohelp, remove all WORD specifics, set up CSS file etc. I unfortunately do no have time for that.

    Any ideas. Perhaps someone knows a way of removing WORD specific tags, style settings etc from the HTM file.

    Thanks for response in advance.

    Robie
    Thanks.
    Robie

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Using CSS in WORD created HTM file (WORD 2000/

    (If you still have it handy, what is the Knowledgebase article you tried?)

    Word's HTML normally includes a <style> tag in the header (there could be an option that controls this...). These style definitions closely track the Word Styles used in the document. Thus, if all documents use the same styles, you should be able to cut and paste the style definitions from the <style> tags to a CSS file and have them work (more or less) across your entire collection of document. Maybe you already tried that.

    I'm not sure what a call-out converts to. Is it a positioned <div>?

    Some programs can help "clean up" Office-proprietary tags. HTML Tidy worked with earlier versions of Word, but I'm not sure it knows the new layouts in Word 2003 (more information available at HTML Tidy Project Page on SourceForge; as with many multi-purpose, multi-platform utilities, it's a bit hard to get into).

    You also could try the HTML export from OpenOffice.org 2.0 beta; even if it does not create a separate css file, it might produce more streamlined HTML (I have not tested yet).

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using CSS in WORD created HTM file (WORD 2000/

    Edited by HansV to provide link to MSKB article using <!t>[mskb=235481]<!/t>

    Thanks for the response.

    <!mskb=235481>Microsoft Knowledge Base Article 235481<!/mskb> is (WD2000: How to Create Cascading Style Sheets in Word 2000). Unfortunately, the instructions are not exactly clear. Sorry, I don't know how to put a link in [img]/forums/images/smilies/sad.gif[/img].

    I did exactly as they suggested but it doesn't make any difference to the style if I change it within the style sheet. May be I don't understand the instructions clearly.

    In the HTML document I have to make the changes under 'View | HTML Source' to include the CSS file instructions. I couldn't find any settings in WORD to do these things or not add bits to the HTML source.

    Robie
    Thanks.
    Robie

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Using CSS in WORD created HTM file (WORD 2000/

    I think the problem with this article is it has nothing to do with fixing or exporting or trimming Word's own "save as web page" style information. Instead, it seems focused on how to create a style sheet to accompany a web page developed without using that feature.

    For Word 2000, Microsoft released an add-in that is supposed to trim out some of the proprietary taggage in exported files. You can find more information here: HOW TO: Use the HTML Filter in Word 2000 and Download details: Office 2000 HTML Filter 2.0.

    For Word 2002 and 2003, something like this is built in, you choose "Web page, filtered" as the file type in the Save As dialog (see Microsoft Office Assistance: Reduce Web page size by filtering HTML).

    But you will still need to cut out the <style></style> section and paste it (without those two tags and without any HTML style comment tags) into a separate mystyles.css file and then link that file to your HTML pages. You can do that by placing a link tag in the <head> section of your pages:

    <link rel="stylesheet" href="mystyles.css" />

    Hope this helps.

  5. #5
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using CSS in WORD created HTM file (WORD 2000/

    Thanks. That was useful. I had been using the 'export' feature but did not have the external CSS file linked in.

    Unfortunately, I have to do my edit in WORD for both the printed and the html guide. It seems that I will need to update the HTM file (with the link to the CSS file) everytime I edit the word document and save it. What a pain [img]/forums/images/smilies/sad.gif[/img]. Is there any way of generating the HTM file with the link built in, i.e. whenever you save the DOC file HTM (or export it) it would include the 'link to CSS' statement? Probably not.

    Also, very importantly, how can I define the CSS file being reference in the HTM file is in the CURRENT folder? Whenever I include this statement in the HTM file it doesn't seem to find it. <link rel="stylesheet" href="mystyles.css" />. The mystyles.css file is in the same directory/folder as the HTM file.

    Thanks again for your input and comments. I have moved on further with them. Much obliged.

    Robie
    Thanks.
    Robie

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Using CSS in WORD created HTM file (WORD 2000/

    Relative paths should work, but what they are relative to can be altered by adding this kind of tag to the <head> section:

    <base href="parentfolder" />

    Does Word add anything similar to that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •