Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Document Management / May 2008

Tip: Looking for answers? Try searching our database.

Problem while inserting a html page into word2000 document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ram Kumar Karnataka - 26 May 2008 15:06 GMT
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
Don - 26 May 2008 15:43 GMT
=?Utf-8?B?UmFtIEt1bWFyIEthcm5hdGFrYQ==?=
<RamKumarKarnataka@discussions.microsoft.com> wrote in
news:D6154844-2310-48F2-B10F-0E0657613C1D@microsoft.com:

> Hello All,
> I'm facing a problem while inserting a html page into the word2000
[quoted text clipped - 33 lines]
>
> 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!
Ram Kumar Karnataka - 27 May 2008 08:30 GMT
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.

> =?Utf-8?B?UmFtIEt1bWFyIEthcm5hdGFrYQ==?=
> <RamKumarKarnataka@discussions.microsoft.com> wrote in
[quoted text clipped - 53 lines]
> monitor types and sizes these days (and have been for some years) and
> your assuming that everybody has the identical monitor that you do!
Don - 27 May 2008 12:32 GMT
=?Utf-8?B?UmFtIEt1bWFyIEthcm5hdGFrYQ==?=
<RamKumarKarnataka@discussions.microsoft.com> wrote in
news:FE49756C-71C6-4C85-821D-59D38434CF87@microsoft.com:

> Hello Don,
> My application has different components which will send html pages to
[quoted text clipped - 17 lines]
> Regards,
> Ram.

Don't believe it's possible.
Bob   Buckland ?:-) - 29 May 2008 00:20 GMT
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/details.aspx?FamilyID=209ADBEE-3FBD-482C-83B0-96F
B79B74DED&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. >>
Signature


Bob  Buckland  ?:-)
MS Office System Products MVP

 *Courtesy is not expensive and can pay big dividends*

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.