Re: Word changes HTML style *** ?

From: Owen Parry (o.parry_at_wales.ac.uk)
Date: 03/02/04


Date: Tue, 2 Mar 2004 14:50:52 -0000

Many thanks for this - it clarified my thinking and I added a simple few
lines to the macro we use for the printing to enforce my own page layout.

It's still irritating that it ignores my style *** when it wants to !

Owen

"Bob Buckland ?:-)" <75214.226(At Beautiful Downtown)compuserve.com> wrote
in message news:OMCssjH$DHA.1212@TK2MSFTNGP12.phx.gbl...
> Hi Owen,
>
> Word 2002's target for creating Web Documents is to be able to
> retain 100% of the original .DOC file, including the ability
> to rebuild that .DOC file even if a browser cannot display all
> of the features and is aimed at users whose want to create a
> web version of their .doc file with no knowledge of web pages/html
> other than 'File=>Save As' (i.e. what's behind what you see is
> not something genearlly cared about by that targeted user). For
> more tailored HTML MS Office Frontpage is more targeted.
>
> If you use Word only for printing the file rather than creating
> and saving a web documents then your Word styles and preferences may kick
> in. You can use File=>Save as Web Page-Filtered and the settings
> in Tools=>Options=>General=>Web Options for more control
> and you can use Word's feature to attach external CSS sheets
>
> For printing, Word will still take its 'direction' from the
> File=>Page Setup dialog and the settings of the printer driver
> from Windows. Check to see if you've set that dialog to 1" (72pt)
> on all four sides and if you've included space for a printable
> header or footer.
>
>
> =======
> <<"Owen Parry" <o.parry@wales.ac.uk> wrote in message
news:Oyvx7As%23DHA.3452@TK2MSFTNGP11.phx.gbl...
> I have a web ASP system which outputs files in html which we then load
into
> Word for printing purposes and to include specialist language fonts. When
> examining the source for the document in Word, it appears to me that Word
is
> inserting a new set of style commands which are overriding the page layout
> we designed for the document and I can't see a way either to stop this
> happening or to alter the values Word is using. The result is that the
> margins used in the printed document are incorrect (we want 72pt all
> margins, Word insists on 72pt, 90pt,72pt and 90pt)
>
> I post here the code and any suggestions are welcome:
>
> Original HTML document:
>
> <HTML>
> <HEAD>
> <meta http-equiv="Content-Language" content="en-gb">
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <link rel="style***" href="http://uwrs99/lmsdocs/css/WelcomeLetter.css"
> type="text/css">
> <title>Welcome Letter</title>
> <body>
> <table Table border=0 cellspacing=0 cellpadding=0 >
> <tr>
> <td width="70%" align="left">Mr John Smith<br>c/o Escuela Superior De
> Somewhere<br><br></td>
> <td width="30%" align="right">19 February 2004</td>
> </tr>
> </table>
> <div class="letterbody">
> <p >Dear John</p>
> <p>It is my pleasure to welcome you, subject to successful matriculation,
> onto the University of Wales
> validated BSc in International Trade, Marketing And Management at the
> Escuela Superior .</p>
> <p>Yours sincerely</p>
> <p>&nbsp;</p>
> <p>John Q Public</p>
> <p><u>Head of Validation Services</u></p>
> </div></body></html>
>
> Contents of CSS file
>
> <STYLE>
> body {
> font-family:"Times New Roman";
> }
> .Letterbody {
> text-align:justify;
> }
> p {
> font-size:10.0pt;
> text-align:left;
> }
> td {
> font-size:10.0pt;
> }
> @page Section1 {
> size:595.35pt 841.95pt;
> margin-top: 172.0pt;
> margin-bottom: 72.0pt;
> margin-right: 72.0pt;
> margin-left: 72.0pt;
> mso-header-margin:35.4pt;
> mso-footer-margin:35.4pt;
> mso-paper-source:0;
> }
> div.Section1 {
> page:Section1;
> }
> </style>
>
>
> Word Document HTML Source
>
> <html xmlns:o="urn:schemas-microsoft-com:office:office"
> xmlns:w="urn:schemas-microsoft-com:office:word"
> xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
> xmlns="http://www.w3.org/TR/REC-html40">
>
> <head>
> <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
> <meta name=ProgId content=Word.Document>
> <meta name=Generator content="Microsoft Word 10">
> <meta name=Originator content="Microsoft Word 10">
> <link rel=File-List href="letters_files/filelist.xml">
> <title>Welcome Letter</title>
> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
> name="date"/>
> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
> name="City"/>
> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
> name="PlaceName"/>
> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
> name="PlaceType"/>
> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
> name="place"/>
> <!--[if gte mso 9]><xml>
> <o:DocumentProperties>
> <o:Author>Owen Parry</o:Author>
> <o:Revision>1</o:Revision>
> <o:TotalTime>0</o:TotalTime>
> <o:Created>2004-02-24T10:19:00Z</o:Created>
> <o:Pages>1</o:Pages>
> <o:Words>56</o:Words>
> <o:Characters>324</o:Characters>
> <o:Company>University of Wales</o:Company>
> <o:Lines>2</o:Lines>
> <o:Paragraphs>1</o:Paragraphs>
> <o:CharactersWithSpaces>379</o:CharactersWithSpaces>
> <o:Version>10.4219</o:Version>
> </o:DocumentProperties>
> </xml><![endif]--><!--[if gte mso 9]><xml>
> <w:WordDocument>
> <w:Zoom>0</w:Zoom>
> <w:GrammarState>Clean</w:GrammarState>
> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
> </w:WordDocument>
> </xml><![endif]--><!--[if !mso]><object
> classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
> <style>
> st1\:*{behavior:url(#ieooui) }
> </style>
> <![endif]-->
> <link rel=Style*** type="text/css" media=all
> href="http://uwrs10/lmsdocs/css/WelcomeLetter.css">
> <style>
> <!--
> /* Style Definitions */
> p.MsoNormal, li.MsoNormal, div.MsoNormal
> {mso-style-parent:"";
> margin:0pt;
> margin-bottom:.0001pt;
> mso-pagination:widow-orphan;
> font-size:12.0pt;
> font-family:"Times New Roman";
> mso-fareast-font-family:"Times New Roman";}
> p
> {font-size:10.0pt;
> font-family:"Times New Roman";
> mso-fareast-font-family:"Times New Roman";}
> p.letterbody, li.letterbody, div.letterbody
> {mso-style-name:letterbody;
> font-size:10.0pt;
> font-family:"Times New Roman";
> mso-fareast-font-family:"Times New Roman";}
> span.GramE
> {mso-style-name:"";
> mso-gram-e:yes;}
> @page Section1
> {size:595.3pt 841.9pt;
> margin:72.0pt 90.0pt 72.0pt 90.0pt;
> mso-header-margin:35.4pt;
> mso-footer-margin:35.4pt;
> mso-paper-source:0;}
> div.Section1
> {page:Section1;}
> -->
> </style>
> <!--[if gte mso 10]>
> <style>
> /* Style Definitions */
> table.MsoNormalTable
> {mso-style-name:"Table Normal";
> mso-tstyle-rowband-size:0;
> mso-tstyle-colband-size:0;
> mso-style-noshow:yes;
> mso-style-parent:"";
> mso-padding-alt:0pt 5.4pt 0pt 5.4pt;
> mso-para-margin:0pt;
> mso-para-margin-bottom:.0001pt;
> mso-pagination:widow-orphan;
> font-size:10.0pt;
> font-family:"Times New Roman";}
> </style>
> <![endif]-->
> <meta http-equiv=Content-Language content=en-gb>
> </head>
>
> <body lang=EN-US style='tab-interval:36.0pt'>
>
> <div class=Section1>
>
> <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
> style='mso-cellspacing:0pt;mso-padding-alt:0pt 0pt 0pt 0pt' Table>
> <tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes'>
> <td width="70%" style='width:70.0%;padding:0pt 0pt 0pt 0pt'>
> <p class=MsoNormal style='margin-bottom:12.0pt'><span
> style='font-size:10.0pt'>Mr
> John Smith<br>
> c/o Escuela Superior Somewhere<o:p></o:p></span></p>
> </td>
> <td width="30%" style='width:30.0%;padding:0pt 0pt 0pt 0pt'>
> <p class=MsoNormal align=right style='text-align:right'><st1:date
> Year="2004"
> Day="19" Month="2"><span style='font-size:10.0pt'>19 February
> 2004</span></st1:date><span
> style='font-size:10.0pt'><o:p></o:p></span></p>
> </td>
> </tr>
> </table>
>
> <p>Dear John</p>
>
> <p>It is my pleasure to welcome you, subject to successful matriculation,
> onto
> the <st1:place><st1:PlaceType>University</st1:PlaceType> of
> <st1:PlaceName>Wales</st1:PlaceName></st1:place>
> validated BSc in International Trade, Marketing <span
class=GramE>And</span>
> Management at the Escuela Superior De Comercio Internacional Y Marketing
> (Escoex), <st1:City><st1:place>Las Palmas</st1:place></st1:City>.</p>
>
> <p>Yours sincerely</p>
>
> <p>&nbsp;</p>
>
> <p>John Q Public</p>
>
> <p><u>Head of Validation Services</u></p>
>
> </div>
>
> </body>
>
> </html>
> ==========>>
> --
> I hope this helps you,
>
> Bob Buckland ?:-)
> MS Office System Products MVP
>
> *Courtesy is not expensive and can pay big dividends*
>
> U.S.: MS Sweepstakes & Office 2003 Contest/Trial Software
> http://microsoftofficecontest.com
>
> Office 2003 explained
> http://microsoft.com/uk/office/editions.asp
>
>
>
>