Roderick
02-04-2018, 01:59 AM
I deal a lot with multi-lingual templates and in one of these I have a style called "Special" which always seems to inherit the language ID of the last one it dealt with. On the other hand the Normal style always 'behaves' itself and uses the correct language selected for it.
What I want to do is write a procedure so that the "Special" style inherits the one set in the Normal style.
My research through Google came up with a few answers but none matched what I needed. Nevertheless, one came quite close by inheriting the font name of the Normal style.
Here is the code:
Public Sub InheritNormalStyle()
Dim oStyle As Style
Set oStyle = ActiveDocument.Styles("Special")
oStyle.Font.Name = oStyle.BaseStyle.Font.Name
'oStyle.LanguageID = oStyle.BaseStyle.LanguageID.Name
End Sub
The font name line works well and you will see I've tried, in the last line, to follow the principle for what I thought might work in the same way for the language ID but it gives me an error when I try to run the procedure.
Can anyone suggest the correct syntax to achieve this, please?
Thanks
Roderick
What I want to do is write a procedure so that the "Special" style inherits the one set in the Normal style.
My research through Google came up with a few answers but none matched what I needed. Nevertheless, one came quite close by inheriting the font name of the Normal style.
Here is the code:
Public Sub InheritNormalStyle()
Dim oStyle As Style
Set oStyle = ActiveDocument.Styles("Special")
oStyle.Font.Name = oStyle.BaseStyle.Font.Name
'oStyle.LanguageID = oStyle.BaseStyle.LanguageID.Name
End Sub
The font name line works well and you will see I've tried, in the last line, to follow the principle for what I thought might work in the same way for the language ID but it gives me an error when I try to run the procedure.
Can anyone suggest the correct syntax to achieve this, please?
Thanks
Roderick