0

I cannot change (i.e., "replace") two of the fonts used in a presentation I inherited that are giving issues to our users.

I have the presentation set to embed fonts, but as I do not have the one in question, I can't fix it like I normally would (i.e., usually having the font in question and opening the file and closing it again embeds the fonts and there are no more issues.)

The font in question in this case is called "Times" (not "Times New Roman", just "Times"), which I believe is an ancient PostScript font, if I'm not mistaken, which would be an issue since, from what I understand, PowerPoint does not support PostScript fonts.

At any rate, I want to replace the font with "Arial", which I know is usually easily accomplished with Replace > Replace Font . . . however, it's not taking for some reason in this file. I'll tell PowerPoint to replace it, it seems to do something, and then . . . no change.

SO. . . I headed to Google and tried a few things (One possibly mentioned by PPTools was converting the file to HTML and back, which is said to fix (i.e., "remove") some Asian and other unsupported fonts from presentations. But as I couldn't figure out how to save a presentation as a Web Page in O365 offline (PowerPoint 2019), it was a no go (there appears to be no option that I can find to either "Save As" or "Export" HTML or a Web Page, as was recommended. I therefore started looking VBA.

My first try was this, as I found was originally used to change Far East Fonts to Arial:

Sub ChgFarEastFontsToArial()
    Dim oSh As Shape
    Dim oSl As Slide

    For Each oSl In ActivePresentation.Slides
        For Each oSh In oSl.Shapes
            If oSh.HasTextFrame Then
                oSh.TextFrame.TextRange.Font.NameFarEast = "Arial"
            End If
        Next
    Next

    For Each oSh In ActivePresentation.SlideMaster.Shapes
        If oSh.HasTextFrame Then
            oSh.TextFrame.TextRange.Font.NameFarEast = "Arial"
        End If
    Next

    If ActivePresentation.HasTitleMaster Then
        For Each oSh In ActivePresentation.TitleMaster.Shapes
            If oSh.HasTextFrame Then
                oSh.TextFrame.TextRange.Font.NameFarEast = "Arial"
            End If
        Next
    End If

End Sub

It runs without error when I don't change anything, but since I wasn't actually looking to change Far East fonts, it didn't help me.

My next try was this:

Sub ReplaceFontToArial()
  Dim objSingleWord As Range
  Dim objDoc As Presentation

  Set objDoc = ActivePresentation

  With objDoc
    For Each objSingleWord In .Words
      If objSingleWord.Font.Name = "Times" Then 
        objSingleWord.Font.Name = "Arial"
      End If
    Next
  End With
End Sub

But, it errors out highlighting ObjSingleWord As Range and stating, Compile error: User-defined type not defined.

Then, upon a suggestion from the Microsoft VBA reference docs, I tried:

Sub ReplaceFontToArial()
  With Application.ActivePresentation
    .Fonts.Replace Original:="Times", Replacement:="Arial"
  End With
End Sub

But this errors out with a Run-time error '424': Object required.

I'm about out of thoughts to fix this problem. Any thoughts on how I can change out this crazy font would be amazing!! (Also advice on why my scripts above are not working would also be helpful.)


FYI, in case it helps, fonts that will not be replaced are:

Times Unsupported font file format (AAT), Times Bold Unsupported font file format (AAT), Times Italic Unsupported font file format (AAT), Times Bold Italic Unsupported font file format (AAT), and Noto Sans Symbols.

4
  • 1
    You might want to break that second paragraph (the large text block, AKA wall of text) into readable paragraphs. It's a little difficult to parse in it's current form.
    – Ken White
    Aug 22, 2019 at 23:59
  • I just created a new blank presentation, created a title that said Test Title, and set the font for that title to Arial. I then added a macro to the presentation that contained just Application.ActivePresentation.Fonts.Replace "Arial", "Times Roman" and then stepped through that code. It not only didn't produce the error you indicate, but it replaced the font as expected. The only way I could reproduce the problem with that code was to start over and not change anything in the blank sheet, which apparently means that Fonts is not assigned until you add a new font to the sheet.
    – Ken White
    Aug 23, 2019 at 0:14
  • @KenWhite I did just as you said and entered the following Macro named "MSReplaceFont" into VBA editor, like so: Application.ActivePresentation.Fonts.Replace "Times", "Arial". I still get Run-time error '424': Object required.
    – lemonbars
    Aug 23, 2019 at 22:16
  • I can repro the error here; if I try to replace a font that's not used by the presentation, the error occurs. Since PS fonts are not supported and since you don't have the font in any case, PPT is substituting a different font for Times; perhaps that's the root of the problem. I have an add-in that's not ready for prime-time that might help. If you want to post your problem file somewhere and pop a link to it here, I'll have a go. Mar 13, 2020 at 2:18

2 Answers 2

3

Times is a Mac font (AAT is Apple Advanced Typography). My preferred technique with stubborn fonts is to change the file ending to .zip, unzip the file to OOXML, then use a text editor like NotePad++ to run a find and replace on all files.

Find: typeface="Times" Replace: typeface="Arial"

Then rezip and rename back to .pptx. Make a copy of the file to experiment. This method also works great on changing PowerPoint language settings.

3
  • John, this sounds like the direction I'd like to go, since none of my scripts worked. What is it that you mean by "unzip the file to OOXML"?
    – lemonbars
    Aug 23, 2019 at 19:33
  • 1
    Change the file ending to ".zip" or add ".zip" to the name. Confirm with the OS that you want to do this. Unzip the file. Edit the XML files. Rezip. Here are more details: brandwares.com/bestpractices/2015/02/… For Mac users: brandwares.com/bestpractices/2015/11/… Aug 23, 2019 at 19:42
  • I will give this a shot and report back. Thanks!
    – lemonbars
    Sep 11, 2019 at 21:24
0

Both 'Replace font' and 'OOOXML transfer' didn't work for me.

For people with Mac OS: open the pptx file with Keynote. A dialog asks to replace missing fonts. Simply replace the ones causing trouble. Then export to Powerpoint.

It should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.