Word VBA convert sentences into html

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

What VBA code would I use to convert sentences or paragraphs of a Word document into html

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Daniel PineaultPresident / Owner CARDA Consultants Inc.
Distinguished Expert 2018

Commented:
Murray BrownHead Developer

Author

Commented:
Apologies. I didn't word the question properly. I want to convert individual sentences or paragraphs into html
President / Owner CARDA Consultants Inc.
Distinguished Expert 2018
Commented:
Beside writing your own function which could be very involved depending on the level of formatting, you could use automation to create a new, hidden, instance of Word, copy over the sentence, save it as HTML and read the content back to a VBA string.
Murray BrownHead Developer

Author

Commented:
Thanks very much. That sounds like a great approach

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial