vba word question

C

chris

Hi all,

I am trying to figure out how to write some string "as HTML" In word using
vbscript. For instance, if you copy some formatted html from IE and then do
a past in word, it shows up as Formatted HTML with the tags rendered
properly. I want to manually build an HTML string and render it to the
document so that it displays as rendered HTML and not the "<tag> text <tag>"
raw HTML.


I am stuck on this for quite some time. I am building the word document
programmatically on the client using vbscript and cannot seem to get this
last bit working. I've scoured VBA articles(I've mostly ported VBA examples
to vbscript for the project so far).

Any help GREATLY appreciated!

Thanks,

Chris
 
J

Jezebel

Don't know how much this will help you with VBScript, but if I were doing
this in VB, I'd look at --

1. Use the Inet control: pass the HTML source string to the control
(packaged into a minimal page if necessary); let the control render the
page; copy the output, paste into Word. Neither the control nor the form
containing it would need to be visible.

2. Set up the clipboard object so Word thinks there's pastable HTML.

3. If the source HTML is simple (eg always along the lines of
<tab>text</tag>), and especially if it's machine generated, write a minimal
parser to interpret the HTML codes and output Word instructions.


No guarantee that any of these will work for you; just some thoughts on how
to start.
 

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