N
N
Nadim Zakirov2021-01-06 14:58:51
Visual Basic
Nadim Zakirov, 2021-01-06 14:58:51

How to insert arbitrary HTML code inside Word using VBA macro?

I rummaged through everything in the documentation , found only many examples of inserting text, but not html code with formatting.

Can anyone suggest a solution? I'm sure it's there, I just don't know what to look for

Sub NewDivision()
 
 With ActiveDocument.HTMLDivisions
 .Add
 .Item(Index:=1).Range.Text = "<b>Привет, мир!</b>"
 End With
 
End Sub


PS The question is not relevant, I found another way to solve the problem without using the html code at all, but if anyone has a desire, you can answer, there will be useful information for future generations)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question