Find&Replace OpenType alternative characters with a macro

Stefano Bianque 21 Reputation points

(I was recommended to ask my question here, so here it goes again)

As the title says, is it possible to record a macro in MS Word that replaces the font's standard lowercase "a" to its alternative "a"?

I have no problems using the Find & Replace function, but recording it with the macro doesn't yield the desired result. And setting the alternative character as standard doesn't help either since it changes all other characters as well. I'm only interested in changing the lowercase "a" alone.

Thanks in advance for the help!
(Sorry if the tags are misleading, but I couldn't create new ones)


An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,596 questions
{count} votes

Accepted answer
  1. Viorel 112.9K Reputation points

    Try something like this:

    With ActiveDocument.Content.Find
        .Text = "a"
        With .Replacement
            .Font.StylisticSet = wdStylisticSet01
        End With
        .Execute Replace:=wdReplaceAll
    End With
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Stefano Bianque 21 Reputation points

    This is the code I get when I record a macro. When I run said macro on a new text/document, it doesn't do anything.
    Just manually using the "Find & Replace"-function works without issues.

    Sub a()
    ' a Makro
    ' alternativt a
        With Selection.Find
            .Text = "a"
            .Replacement.Text = "a"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
        Selection.Find.Execute Replace:=wdReplaceAll
    End Sub
    0 comments No comments