I have a code that loops through the paragraphs of a document, and reapplies the heading style. This is in order to fix the numbering inconsistency after copy-pasting headings from different documents.
In my file I just have the following example:
For Each p In ThisDocument.Paragraphs
If p.Style = "Heading 1" Then
p.Style = "Heading 1"
End If
Next p
This solves the issue, but the problem is if somebody has Word running in a different language, "Heading 1" is not applicable anymore. I tried with wdstyleheading1 as well, but the p.Style always reads out the actual name of the style, not an enumeration.
I thought of p.Style.ListLevelNumber, but that seems to be too vague, and might mess up other lists in the document.
Is there a way to read or reference it in a language independent way? Is there perhaps a better solution altogether for the numbering problem?