J
John Socolofsky
I would like to find a VBA method that can take a
selection within a Word file as input and convert whatever
it finds within the selection from HTML to Word format and
paste it back into the Word file in place of the HTML.
What I am trying to do is take a Word file that contains
text, bulleted lists, and images, along with straight HTML
bounded by tags. I want to parse the Word file and when I
hit a starting bounding tag (something like [html on]) I
want to start converting everything from HTML to Word
until I find an ending bounding tag (something like [html
off].
An example:
________________________________________________________
This is some text in the Word file that is to be left
untouched. This is some text in the Word file that is to
be left untouched. This is some text in the Word file that
is to be left untouched. This is some text in the Word
file that is to be left untouched.
[html on]
<table border cellspacing=5 cellpadding=3>
<tr>
<td>some stuff</td><td>some more stuff</td><td>still more
stuff</td>
</tr>
<tr>
<td>some stuff row 2</td><td>some more stuff</td><td>still
more stuff</td>
</tr>
<tr>
<td>some stuff row 3</td><td>some more stuff</td><td>still
more stuff</td>
</tr>
</table>
[html off]
This is some text in the Word file that is to be left
untouched. This is some text in the Word file that is to
be left untouched. This is some text in the Word file that
is to be left untouched. This is some text in the Word
file that is to be left untouched.
________________________________________________________
I want the parsing and converting script/methods to work
with the straight HTML in the middle and leave everything
else untouched. What you should end up with is the
beginning and ending text and a Word table in between.
Does anyone know of an existing converter that will do
this? Seems to me that the basic functionality to convert
HTML to Word is built into Word already - is there a way
to tap into it with VBA?
Many thanks in advance...
selection within a Word file as input and convert whatever
it finds within the selection from HTML to Word format and
paste it back into the Word file in place of the HTML.
What I am trying to do is take a Word file that contains
text, bulleted lists, and images, along with straight HTML
bounded by tags. I want to parse the Word file and when I
hit a starting bounding tag (something like [html on]) I
want to start converting everything from HTML to Word
until I find an ending bounding tag (something like [html
off].
An example:
________________________________________________________
This is some text in the Word file that is to be left
untouched. This is some text in the Word file that is to
be left untouched. This is some text in the Word file that
is to be left untouched. This is some text in the Word
file that is to be left untouched.
[html on]
<table border cellspacing=5 cellpadding=3>
<tr>
<td>some stuff</td><td>some more stuff</td><td>still more
stuff</td>
</tr>
<tr>
<td>some stuff row 2</td><td>some more stuff</td><td>still
more stuff</td>
</tr>
<tr>
<td>some stuff row 3</td><td>some more stuff</td><td>still
more stuff</td>
</tr>
</table>
[html off]
This is some text in the Word file that is to be left
untouched. This is some text in the Word file that is to
be left untouched. This is some text in the Word file that
is to be left untouched. This is some text in the Word
file that is to be left untouched.
________________________________________________________
I want the parsing and converting script/methods to work
with the straight HTML in the middle and leave everything
else untouched. What you should end up with is the
beginning and ending text and a Word table in between.
Does anyone know of an existing converter that will do
this? Seems to me that the basic functionality to convert
HTML to Word is built into Word already - is there a way
to tap into it with VBA?
Many thanks in advance...