Thread: [Solved] HTML Class to Word Styles
View Single Post
 
Old 08-17-2023, 05:24 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I had a fiddle with this and had some clues after exporting a Word doc in HTML format and looking at that output. As a result I found that you can import styles like this
Code:
<p Class=MsoBodyText>Body Text Vestibulum ut diam magna. Maecenas ut interdum ante, vel volutpat nibh</p>
<p Class=MsoList>List Vestibulum ut diam magna. Maecenas ut interdum ante, vel volutpat nibh</p>
<p Class=MsoListNumber>List Number Vestibulum ut diam magna. Maecenas ut interdum ante, vel volutpat nibh</p>
<p Class=MsoHeading1>Heading 1 Vestibulum ut diam magna. Maecenas ut interdum ante, vel volutpat nibh</p>
<p Class=MsoTitle>Heading 2 Vestibulum ut diam magna. Maecenas ut interdum ante, vel volutpat nibh</p>
It looks like there are built-in MsoXXX names that map to built-in styles and you can also use 'invalid' names to have the content styled with a custom style (or style alias).
For instance most of these above worked but the p Class=MsoHeading1 created a new style called msoheading1. This is not the end of the world since I should have used H1 instead of p anyway.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote