how can i write some html code to word document?

L

licy

code like below, but in word, it just like original code, i want to see text
with format, just like in web, how can i do?

Dim oWord As Word.Application
Set oWord = New Word.Application

Dim doc As Word.Document
Set doc = oWord.Documents.Add(Visible:=True)
oWord.Visible = True

oWord.Selection.range.text = "<html><body><b>hello</b> all</body></html>"


oWord.Quit savechanges:=wdPromptToSaveChanges
 
C

Chay Harley

Sorry, just to clarify - do you want to make a document in word, and then
save it as HTML so you can use it as a web page?
 
L

licy

vba get some data from other application, they are in html format, I want
insert the data to word docment, How can VBA deal this?
 

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