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 text
is separated from the image to facilitate easy localization.

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 /><p>Filter points</p><table><tr class="TabHead"><td>No.</td>
<td>Description</td><td>Range</td><td>Default</td><td>Value</td></tr><tr><td>S.1.3</td>
<td>filter time period</td><td>0 ... 600 Min</td>
<td>60 Min</td>
<td>60 Min</td>
</tr>
</table>
</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
 
B

Bob Buckland ?:-\)

Hi Ram,

While it's a bit difficult to know how the whole thing would behave without having a link to the full HTML page and a picture of how
it shoudl look <g> it appears that some of the differences between how Word and IE handle HTML is coming into play.

With only a couple of minutes to look at it, it *may* be that the graphic in this case, when the .htm file is opened or inserted
into Word, comes in as 'inline with text' (i.e. it's treated like a large text character) and as Word has already placed the graphic
as part of the text flow the text that it then reads from your file is placed after it.

Word 2000 was the first implementation of internal handling of HTML by Word and it wasn't quite as refined as later versions of
Word, at least as far as using CSS for positiong, but the behaviors in Word and IE aren't identical and would give similar results
in later Word versions.
http://support.microsoft.com/kb/212270

If you create the same layout in Word in Web Layout view and then preview in browser and view source you can see how Word would
'code' for the layout. When you save a web document from Word it preserves all of the elements it needs to render it again in Word
like the original Word document, but not necessarily the other way around :).

If you have the file open in IE and use File=>Edit with Microsoft Word then in Word go to File=>Web Page Preview it appears that
Word has preserved the placement CSS.

===============
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 text
is separated from the image to facilitate easy localization.

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 /><p>Filter points</p><table><tr class="TabHead"><td>No.</td>
<td>Description</td><td>Range</td><td>Default</td><td>Value</td></tr><tr><td>S.1.3</td>
<td>filter time period</td><td>0 ... 600 Min</td>
<td>60 Min</td>
<td>60 Min</td>
</tr>
</table>
</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 >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 
R

Ram Kumar Karnataka

Hello Bob,
Its not only image creating the problem but even with simple html text with
<div> tag and "style" attributes have a problem.
For example, pls have look at the below html code:

<html>
<div style="width: 247px; height: 12px; position: absolute; left: 150px;
top: 100px;">
<span style="color: #ff3333">
<strong>filtered outside air temperature</strong>
</span>
</div>
</html>


This html when opened in IE preserved the positioning info whereas word
doesnt.

Can you please suggest some html tags which can be recognized by both IE and
MS Word so that the text/image comes exactly at the specified location?

Thanks

Regards
Ram.
 

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