Newly added heading styles not showing

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
TeSol
Sr. Propeller Head
Posts: 114
Joined: Wed Sep 14, 2011 12:02 am

Newly added heading styles not showing

Post by TeSol »

Hi,

I need heading7 and heading8 in my printed documentation. Hence, I added these 2 styles in the CSS. However, if I filter the box to 'show Heading Styles' then h7 and h8 do not display. They appear only when Show all Styles is selected. If I open any topic also, these 2 styles do not show in the Styles drop-down box.

Where am I going wrong?

Any help would be much appreciated.

Thanks
TeSol
devjoe
Sr. Propeller Head
Posts: 342
Joined: Thu Jan 23, 2014 1:43 pm

Re: Newly added heading styles not showing

Post by devjoe »

HTML doesn't actually have h7 and h8 tags. The usual workaround for this is to make subclasses of h6 called h6.heading7 and h6.heading8.
If, for some reason, you have headings this deep included in a table of contents, set the mc-heading-level property on these to 7 and 8 to get them to show up where they should in the TOC and PDF bookmarks, or set it to 0 to have them not show.
TeSol
Sr. Propeller Head
Posts: 114
Joined: Wed Sep 14, 2011 12:02 am

Re: Newly added heading styles not showing

Post by TeSol »

Thank you so much devjoe...that worked!

I was able to create the h7 and h8 styles in Flare and apply them wherever relevant.

One issue now is that somehow the headings are not appearing at all in the Navigation pane in Word. Not sure why...any tips?

Regards,
TeSol
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Newly added heading styles not showing

Post by Nita Beck »

That's because your h7 and h8 styles are custom styles, and Flare 12 has been programmed to map only true h1 - h6 styles to Word's Heading 1 - Heading 6 styles. But post-generation, you can either swap the h7 and h8 styles for Word's Heading 7 and Heading 8 styles OR you can modify your h7 and h8 styles in Word to be mapped to outline levels 7 and 8. (This is what we all have had to do prior to Flare 12 for all heading styles, as Flare wasn't programmed to map any h styles to any Heading styles.)
TeSol
Sr. Propeller Head
Posts: 114
Joined: Wed Sep 14, 2011 12:02 am

Re: Newly added heading styles not showing

Post by TeSol »

Thanks Nita.

Actually, it is not the h7 and h8 styles alone..none of the headings show in the Navigation pane. But your answer tells me that is normal in anything before Flare 12 (I use Flare 10).

So how do I map the headings between Flare and Word?

.......

I think I just figured it. Base the Flare style on the Word style..i.e. h1 on Heading 1 and so on. Right?
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Newly added heading styles not showing

Post by Nita Beck »

TeSol wrote:I think I just figured it. Base the Flare style on the Word style..i.e. h1 on Heading 1 and so on. Right?
No, that won't do it. You have to do the mapping in Word, not in Flare.

In Word, you can either search and replace a Flare style, such as h1, with a Word style, such as Heading 1.

OR, you can modify the style for h1 so that its outline level is set to 1. Modify h2 so its outline level is set to 2. And so forth.

What many of us (this is pre-Flare 12) have done is to craft a macro in Word that can make all the modifications in one pass. I then put a button for my macro on Word's Quick Access Bar so I just have to click a button and voila, I'd then see headings in the Navigation pane.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Paulie
Sr. Propeller Head
Posts: 140
Joined: Sun Mar 01, 2015 3:01 pm

Re: Newly added heading styles not showing

Post by Paulie »

Here's the macro to update the styles in Word:

Code: Select all

Sub Assign_HLevels()

    On Error Resume Next

    'Update headings:
    ActiveDocument.Styles("h1").ParagraphFormat.OutlineLevel = wdOutlineLevel1
    ActiveDocument.Styles("h2").ParagraphFormat.OutlineLevel = wdOutlineLevel2
    ActiveDocument.Styles("h2_1").ParagraphFormat.OutlineLevel = wdOutlineLevel2
    ActiveDocument.Styles("h3").ParagraphFormat.OutlineLevel = wdOutlineLevel3
    ActiveDocument.Styles("h4").ParagraphFormat.OutlineLevel = wdOutlineLevel4
    ActiveDocument.Styles("h5").ParagraphFormat.OutlineLevel = wdOutlineLevel5
    ActiveDocument.Styles("h6").ParagraphFormat.OutlineLevel = wdOutlineLevel6
    ActiveDocument.Styles("h6_h7").ParagraphFormat.OutlineLevel = wdOutlineLevel7
	ActiveDocument.Styles("h6_h8").ParagraphFormat.OutlineLevel = wdOutlineLevel8
         
End Sub
Alternatively, the following Macro will run each time that Word is opened, but only update the document if it was created in Flare and never updated before:

Code: Select all

Sub AutoOpen()

On Error GoTo ExitSub:

If Application.Documents.Count = 0 Then Exit Sub
If TestIfFlareDocument() = False Then Exit Sub

Application.ScreenUpdating = False
Call Assign_HLevels
Call UpdateTitleAndAuthorInfo

ActiveDocument.Save
ExitSub:

Application.ScreenUpdating = True
End Sub



Sub Assign_HLevels()

    On Error Resume Next

    'Update headings:
    ActiveDocument.Styles("h1").ParagraphFormat.OutlineLevel = wdOutlineLevel1
    ActiveDocument.Styles("h2").ParagraphFormat.OutlineLevel = wdOutlineLevel2
    ActiveDocument.Styles("h3").ParagraphFormat.OutlineLevel = wdOutlineLevel3
    ActiveDocument.Styles("h4").ParagraphFormat.OutlineLevel = wdOutlineLevel4
    ActiveDocument.Styles("h5").ParagraphFormat.OutlineLevel = wdOutlineLevel5
    ActiveDocument.Styles("h6").ParagraphFormat.OutlineLevel = wdOutlineLevel6
    ActiveDocument.Styles("h6_h7").ParagraphFormat.OutlineLevel = wdOutlineLevel7
	ActiveDocument.Styles("h6_h8").ParagraphFormat.OutlineLevel = wdOutlineLevel8
         
End Sub

Sub UpdateTitleAndAuthorInfo()
Set Doc = ActiveDocument
With Doc
.BuiltInDocumentProperties("Author") = "Your Company Name"
.BuiltInDocumentProperties("Company") = "Your Company Name"

End With

End Sub

Function TestIfFlareDocument()

If ActiveDocument.BuiltInDocumentProperties("Author") = "MadCap Software" Then
TestIfFlareDocument = True
Else
TestIfFlareDocument = False
End If
End Function
Tip: This works by only executing if the author name is "MadCap Software". (This is how the script tests whether the document was created by Flare). The company and author are also renamed to ensure that the script only runs once (update "Your Company Name" to the company name that you want to display in your word documents).
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Newly added heading styles not showing

Post by Nita Beck »

<like>@ Paulie!</like> :wink:
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Post Reply