Problem while inserting a html page into word2000 document

  • Thread starter Ram Kumar Karnataka
  • Start date
R

Ram Kumar Karnataka

Hello All,
I'm facing a problem while inserting a html page into the word2000 document.
The speciality of the html page is - it contains images with text.

The problem arises when i insert the html page into the word, the text which
should be positioned at certain places along side the image are all coming at
the bottom of the image, which makes the image not readable.

If i open the same html page using the webbrowser, its absolutely fine. The
text is embedded inside the <div> and <span> tags.

The html will look like as shown below:

<img src="file://C:\ABC.ico" alt="ABC" style="position: relative; left: 4px;
top: 12px; width: 395px;" />
<div style="width: 247px; height: 12px; position: absolute; left: 75px; top:
10px;"><span style="color: #ff3333">
<strong>Sample image</strong></span></div>
<div style="width: 49px; height: 12px; position: absolute; left: 343px; top:
190px;"> X-Axis
</div><div style="width: 243px; height: 23px; position:
absolute; left: 78px; top: 192px;">
point
</div>
</div></div>
<div><br />
</div>

Indeed, the problem seems to be like Word is not preserving the position
information of texts in "div" element and style attributes.

Can anyone please help in this regard?

Thanks
 
D

Don

=?Utf-8?B?UmFtIEt1bWFyIEthcm5hdGFrYQ==?=
Hello All,
I'm facing a problem while inserting a html page into the word2000
document. The speciality of the html page is - it contains images with
text.

The problem arises when i insert the html page into the word, the text
which should be positioned at certain places along side the image are
all coming at the bottom of the image, which makes the image not
readable.

If i open the same html page using the webbrowser, its absolutely
fine. The text is embedded inside the <div> and <span> tags.

The html will look like as shown below:

<img src="file://C:\ABC.ico" alt="ABC" style="position: relative;
left: 4px; top: 12px; width: 395px;" />
<div style="width: 247px; height: 12px; position: absolute; left:
75px; top: 10px;"><span style="color: #ff3333">
<strong>Sample image</strong></span></div>
<div style="width: 49px; height: 12px; position: absolute; left:
343px; top: 190px;"> X-Axis
</div><div style="width: 243px; height: 23px;
position:
absolute; left: 78px; top: 192px;">
point
</div>
</div></div>
<div><br />
</div>

Indeed, the problem seems to be like Word is not preserving the
position information of texts in "div" element and style attributes.

Can anyone please help in this regard?

Thanks

1) Word is not a web browser or html editior, it was NEVER intended for
either.
2) You have not mentioned the SOURCE of your inserted page?
3) Is the inserted web page compliant?
4) the "wrap" settings for Word and html are two entirely different
creatures, not to mention if your inserted web page utilizes html-
Cascading Style Sheets (NOT Word's CSS).
5) Should you desire an exact veiwing of of the inserted page that is
viewed identically in all platforms (i. e., operating systems), the most
effective way to achieve this is NOT with the use of Word, rather a PDF
file.
6) In addition the "absolute" settings that your conversion atttempt
utilizes are a BAD practice in web pages. People are using a variety of
monitor types and sizes these days (and have been for some years) and
your assuming that everybody has the identical monitor that you do!
 
R

Ram Kumar Karnataka

Hello Don,
My application has different components which will send html pages to the
framework which then has to include(insert) all these html pages and show it
in word document.
yes indeed each html page returned by the individual component has the CSS
file, it'll look like as below:

<style type="text/css">
<!--
A { color: Blue; }
A:active,
A:hover { color: Red; }
A:visited { color:purple; }

table
{
font-size: 10pt;
font-family: Arial;
border-right: #696969 1px solid;
border-top: #696969 1px solid;
border-left: #696969 1px solid;
border-bottom: #696969 1px solid;
}
.TabHead
{
height: 12px;
font-weight: bold;
background-color: #ccff66;
}
ul
{
margin-top: 0pt;
margin-bottom: 2pt;
}

li
{
list-style-position: outside;
font-size: 10pt;
font-family: Arial;
margin-top: 0pt;
margin-bottom: 0pt;
}
.liTab
{
text-indent: -20px;
list-style-type: circle;
}
tr
{
}
.oddrow
{
background-color: #faffef;
}
.evenrow
{
background-color: #ffffff;
}
.mmirow
{
background-color: #99ff00;
}

td
{
padding-left: 4pt;
border-right: #a9a9a9 1px ridge;
border-top: #a9a9a9 1px ridge;
border-left: #a9a9a9 1px ridge;
border-bottom: #a9a9a9 1px ridge;
vertical-align: top;
}
.tdright
{
text-align: right;
}


h3
{
font-family: Arial;
}
h4
{
font-size: 10pt;
font-family: Arial;
margin-top: 11pt;
margin-bottom: 5pt;
font-weight: bold;
text-transform: capitalize;
}
p
{
font-size: 10pt;
font-family: Arial;
text-indent: 0pt;
text-align: left;
margin-top: 0pt;
margin-bottom: 0pt;
}
.dist2pt
{
margin-top: 2pt;
margin-bottom: 2pt;
}

div
{
font-size: 10pt;
font-family: Arial;
}
.dbold
{
font-weight:bold;
}
-->
</style>

Right now, Web Browser is displaying the text exactly at the position where
i want to be...but Word document is somehow missing this positioning
information.

I suspect this is because the advanced html tags like <DIV> <SPAN> and
attributes like STYLE cannot be recognised by Word document. If we use basic
html tags like <PRE>, <P> its showing correctly in both IE and WORD.

Please let me know what i have to do to have a consistent proper view in
both IE and WORD?


Regards,
Ram.
 
D

Don

=?Utf-8?B?UmFtIEt1bWFyIEthcm5hdGFrYQ==?=
Hello Don,
My application has different components which will send html pages to
the framework which then has to include(insert) all these html pages
and show it in word document.
yes indeed each html page returned by the individual component has the
CSS file, it'll look like as below:

Right now, Web Browser is displaying the text exactly at the position
where i want to be...but Word document is somehow missing this
positioning information.

I suspect this is because the advanced html tags like <DIV> <SPAN> and
attributes like STYLE cannot be recognised by Word document. If we use
basic html tags like <PRE>, <P> its showing correctly in both IE and
WORD.

Please let me know what i have to do to have a consistent proper view
in both IE and WORD?


Regards,
Ram.

Don't believe it's possible.
 
B

Bob Buckland ?:-\)

Hi Ram,

The ability to attach external CSS style sheets to Word a Word file came after Word 2000. Word 2000 was the first of the 'round trip
to web document and back to Word document' versions and has a few more quirks than later versions.

A good portion of the the .CSS file you posted has equivalents in Word 2000 so what you may want to try is to

(a) Install the Office 2000 HTML Filter to enable
File=>Export to=>Compact HTML (known in later Word versions as a built in, Web Page-Filtered choice.
http://microsoft.com/downloads/deta...EE-3FBD-482C-83B0-96FB79B74DED&displaylang=en

(b) Create the page/content look you want in Word 2000 using Word styles and possibly a table to position the text and graphic,
then save the page in Word 2000 as both 'HTML' and as 'Web page' and look at the source to see how Word created the result,
including its internal CSS (i.e. what it recognizes) then mimic that in the pages you're creating to feed back to Word. Also
verify that Word recreates the document from Word the same when reopened in Word. It may not do so if you save using the filter.

Word's behavior from inserting a file vs opening one can be different.

=================
Hello Don,
My application has different components which will send html pages to the
framework which then has to include(insert) all these html pages and show it
in word document.
yes indeed each html page returned by the individual component has the CSS
file, it'll look like as below:

<style type="text/css">
<!--
A { color: Blue; }
A:active,
A:hover { color: Red; }
A:visited { color:purple; }

table
{
font-size: 10pt;
font-family: Arial;
border-right: #696969 1px solid;
border-top: #696969 1px solid;
border-left: #696969 1px solid;
border-bottom: #696969 1px solid;
}
..TabHead
{
height: 12px;
font-weight: bold;
background-color: #ccff66;
}
ul
{
margin-top: 0pt;
margin-bottom: 2pt;
}

li
{
list-style-position: outside;
font-size: 10pt;
font-family: Arial;
margin-top: 0pt;
margin-bottom: 0pt;
}
..liTab
{
text-indent: -20px;
list-style-type: circle;
}
tr
{
}
..oddrow
{
background-color: #faffef;
}
..evenrow
{
background-color: #ffffff;
}
..mmirow
{
background-color: #99ff00;
}

td
{
padding-left: 4pt;
border-right: #a9a9a9 1px ridge;
border-top: #a9a9a9 1px ridge;
border-left: #a9a9a9 1px ridge;
border-bottom: #a9a9a9 1px ridge;
vertical-align: top;
}
..tdright
{
text-align: right;
}


h3
{
font-family: Arial;
}
h4
{
font-size: 10pt;
font-family: Arial;
margin-top: 11pt;
margin-bottom: 5pt;
font-weight: bold;
text-transform: capitalize;
}
p
{
font-size: 10pt;
font-family: Arial;
text-indent: 0pt;
text-align: left;
margin-top: 0pt;
margin-bottom: 0pt;
}
..dist2pt
{
margin-top: 2pt;
margin-bottom: 2pt;
}

div
{
font-size: 10pt;
font-family: Arial;
}
..dbold
{
font-weight:bold;
}
-->
</style>

Right now, Web Browser is displaying the text exactly at the position where
i want to be...but Word document is somehow missing this positioning
information.

I suspect this is because the advanced html tags like <DIV> <SPAN> and
attributes like STYLE cannot be recognised by Word document. If we use basic
html tags like <PRE>, <P> its showing correctly in both IE and WORD.

Please let me know what i have to do to have a consistent proper view in
both IE and WORD?


Regards,
Ram. >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 

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