Importing of HTML files using footer: Text resides at both footerand text body

P

Peter Müller

I tried to import the HTML file listed below into Word 2003. I took it from
http://groups.google.com/group/DotNetDevelopment/browse_thread/thread/95d9fee028a3c2f2
but changed it to static HTML code. When I try to open the file using
Word 2003 I get the footer but also the text of the footer appears
inside the body of the Word document. I tried to use another source
concerning with footer but that information yields the same effect, How
can I provide that the header information doesn't appear in the body
anymore?


<html xmlns:eek:='urn:schemas-microsoft-com:eek:ffice:eek:ffice'
xmlns:w='urn:schemas-microsoft-com:eek:ffice:word'
xmlns='http://www.w3.org/TR/REC-html40'>
<head>
<title></title>
<!--[if gte mso9]>
<xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:Zoom>90</w:Zoom>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml>
<![endif]-->

<style>

p.MsoFooter, li.MsoFooter, div.MsoFooter{
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:center 3.0in right 6.0in;
font-size:8.0pt;
}

p.MsoHeader, li.MsoHeader, div.MsoHeader{
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:center 3.0in right 6.0in;
font-size:8.0pt;
}

@page Section1 {
size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header: h1;
mso-header-margin:.5in;
mso-footer: f1;
mso-footer-margin:.5in;
mso-paper-source:0;
}

div.Section1 {
page:Section1;
}

</style>
</head>
<body lang=EN-US style='tab-interval:.5in;font-family:Arial;'>
<div class=Section1>
<p style='color:black; font-size:15pt; font-weight:bold;'>
AAA
</p>
<p style='color:gray;font-size:12pt;
font-weight:bold;font-style:italic;'>
BBB
</p>
</div>
<div style='mso-element:header;' id=h1>
<p class=MsoHeader>
<span style='mso-tab-count:1'></span>
CCC
</p>
</div>
<div style='mso-element:footer;' id=f1>
<p class=MsoFooter>
DDD
<span style='mso-tab-count:1'></span>
EEE
<span style='mso-field-code:\" PAGE \"'></span>
FFF
<span style='mso-field-code:\" NUMPAGES \"'></span>
</p>
</div>
</body>
</html>
 
P

Peter Jamieson

I can't say I know a great deal about this, but...

If you just need to be able to generate a single "text format file" that
you can open in Word, AFAICS the problem here is that Word is expecting
a. to have an empty footer section
b. to find the actual footer in a separate "supporting file"
c. to have a reference to that footer in a style called @page or some
such.

In other words, you need multiple files. But you can avoid that by
saving a .mht/.mhtml file instead. Although these seem to be little
used, they are little more than MIME format files that put all those
separate supporting files into a single file, just as if they were in an
email.

You would still have to work out what exactly needs to be in there and
what does not, but I suspect you would be able to pare them down quite a
lot.

Peter Jamieson

http://www.shetlandtimes.co.uk/shop/product.php?productid=166

I tried to import the HTML file listed below into Word 2003. I took it from
http://groups.google.com/group/DotNetDevelopment/browse_thread/thread/95d9fee028a3c2f2

but changed it to static HTML code. When I try to open the file using
Word 2003 I get the footer but also the text of the footer appears
inside the body of the Word document. I tried to use another source
concerning with footer but that information yields the same effect, How
can I provide that the header information doesn't appear in the body
anymore?


<html xmlns:eek:='urn:schemas-microsoft-com:eek:ffice:eek:ffice'
xmlns:w='urn:schemas-microsoft-com:eek:ffice:word'
xmlns='http://www.w3.org/TR/REC-html40'>
<head>
<title></title>
<!--[if gte mso9]>
<xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:Zoom>90</w:Zoom>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml>
<![endif]-->

<style>

p.MsoFooter, li.MsoFooter, div.MsoFooter{
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:center 3.0in right 6.0in;
font-size:8.0pt;
}

p.MsoHeader, li.MsoHeader, div.MsoHeader{
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:center 3.0in right 6.0in;
font-size:8.0pt;
}

@page Section1 {
size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header: h1;
mso-header-margin:.5in;
mso-footer: f1;
mso-footer-margin:.5in;
mso-paper-source:0;
}

div.Section1 {
page:Section1;
}

</style>
</head>
<body lang=EN-US style='tab-interval:.5in;font-family:Arial;'>
<div class=Section1>
<p style='color:black; font-size:15pt; font-weight:bold;'>
AAA
</p>
<p style='color:gray;font-size:12pt;
font-weight:bold;font-style:italic;'>
BBB
</p>
</div>
<div style='mso-element:header;' id=h1>
<p class=MsoHeader>
<span style='mso-tab-count:1'></span>
CCC
</p>
</div>
<div style='mso-element:footer;' id=f1>
<p class=MsoFooter>
DDD
<span style='mso-tab-count:1'></span>
EEE
<span style='mso-field-code:\" PAGE \"'></span>
FFF
<span style='mso-field-code:\" NUMPAGES \"'></span>
</p>
</div>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top