If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Is it possible for MS Word to apply pasted HTML tags?

Word 2003 can read HTML, so I can imagine an approach of saving (or writing by means of VBA) your HTML snippet to a temporary plain text file, then again open it with Word as HTML and copy-paste the now formatted text to the desired destination. However, that does not work with your sample HTML snippet from post #1 as-is. You'd probably need to wrap it into a proper HTML skeleton to turn it into a valid HTML file.

Another approach I can think of is simply just supporting a small subset of HTML, interpret the tags yourself and apply the formatting in your VBA code. Shouldn't be too complicated either, but of course the effort largely depends on how extensive you want your HTML support to be.

I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Re: Is it possible for MS Word to apply pasted HTML tags?

Originally Posted by Eri523

Word 2003 can read HTML, so I can imagine an approach of saving (or writing by means of VBA) your HTML snippet to a temporary plain text file, then again open it with Word as HTML and copy-paste the now formatted text to the desired destination. However, that does not work with your sample HTML snippet from post #1 as-is. You'd probably need to wrap it into a proper HTML skeleton to turn it into a valid HTML file.

Another approach I can think of is simply just supporting a small subset of HTML, interpret the tags yourself and apply the formatting in your VBA code. Shouldn't be too complicated either, but of course the effort largely depends on how extensive you want your HTML support to be.

Please show me how Word can save and read HTML. I couldn't locate HTML in "Save As" list.
Thanks for attention.

Re: Is it possible for MS Word to apply pasted HTML tags?

I am using Word 2002 under the file menu is Save As which has the following options web page *.htm|*.html, web page filtered, web archive, rich text and so on
There is also a save as web page on the file menu just below the save as.

Re: Is it possible for MS Word to apply pasted HTML tags?

Originally Posted by Bruin 1953

Please show me how Word can save and read HTML. I couldn't locate HTML in "Save As" list.

Saving has already been explained by DataMiser. However, taking the approach I suggested, you wouldn't save as HTML anyway, instead you would save as plain text (i.e. unformatted). Opening an HTML file using Word's GUI works more or less the same as saving; just pick "Web Pages" as the file type to open.

Programmatically opening an HTML file would be done using a VBA command like this one: