It should be easy enough to find the current language and set the styles accordingly
Maybe something this
Option Explicit
Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String, _
ByVal cchData As Long) As Long
Public Const LOCALE_USER_DEFAULT As Long = &H400
Public Const LOCALE_SABBREVLANGNAME As Long = &H3
Sub RemoveFormattingFromNoteNumbers()
'
' Delete attributes from all note call numbers
'
Dim varNoteTypes As Variant
Dim varNoteType As Variant
Dim sLang As String, sFootnoteStyle As String, sEndnoteStyle As String
sLang = pvtGetInfo(LOCALE_SABBREVLANGNAME)
MsgBox sLang
Select Case sLang
Case "ENU"
sFootnoteStyle = "Footnote Reference"
sFootnoteStyle = "Footnote Reference"
Case "FR" '????? note sure
sFootnoteStyle = "Appel note de bas de p."
sFootnoteStyle = "Appel de note de fin"
End Select
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^f"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = False
Do While .Execute = True
Selection.Style = sFootnoteStyle
Selection.Collapse Direction:=wdCollapseEnd
Loop
End With
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^e"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = False
Do While .Execute = True
Selection.Style = sEndnoteStyle
Selection.Collapse Direction:=wdCollapseEnd
Loop
End With
End Sub
Function pvtGetInfo(ByVal lInfo As Long) As String
Dim Buffer As String
Dim ret As String
Buffer = String$(256, 0)
ret = GetLocaleInfo(LOCALE_USER_DEFAULT, lInfo, Buffer, Len(Buffer))
If ret > 0 Then
pvtGetInfo = Left$(Buffer, ret - 1)
Else
pvtGetInfo = vbNullString
End If
End Function