Consulting

Results 1 to 3 of 3

Thread: Text font change in VBA

  1. #1

    Text font change in VBA

    Dear all
    I have problem with my document, I type my word document with caribri font but now I want to change only numberic in to Time New Roman font so is there any way to change all numberic font.
    anyone can help me please!

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,334
    Location
    Sub ScratchMacro()
    'A basic Word macro coded by Greg Maxey
    Dim oRng As Range
      Set oRng = ActiveDocument.Range
        With oRng.Find
          .Text = "([$.,0-9]{1,})"
          .MatchWildcards = True
          While .Execute
            oRng.Font.Name = "Times New Roman"
          Wend
        End With
    lbl_Exit:
      Exit Sub
    End Sub
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    VBAX Contributor
    Joined
    Jul 2020
    Location
    Sun Prairie
    Posts
    119
    Location
    Hi Greg,
    Just curious.
    Will this replace numbers generated by list numbering? by fields? or only typed text?

    I tried it and it changed the number generated by a SEQ field without any FORMAT switch. It did not change a list number.
    It may be all Vansit needs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •