Eran Kaufman
Eran Kaufman

Reputation: 13

Replace fonts with VBA in Powerpoint

I need to replace fonts in a Powerpoint presentation (replace function was unable to do so). I found a VBA script from Microsoft, but I don't know what to do next. anyone can help?

https://learn.microsoft.com/en-us/office/vba/api/powerpoint.fonts.replace

Upvotes: 1

Views: 729

Answers (1)

John Korchok
John Korchok

Reputation: 4913

To use that line of code, it's enough to run it from the Immediate window of the Visual Basic editor. Use Alt + F11 or Alt + L + V to open the VBE. The Immediate window is at the bottom, paste in the code and tap the Enter key to run it: VBA Editor showing Immediate window

In case the VBA is not enough to change the font, you can perform the job with an OOXML hack. Change the file ending to .zip and expand it. Then use a text editor like NotePad++ to run a find and replace on all the files, changing

typeface="Time New Roman"

to

typeface="Courier"

Rezipping using the Windows Zip utility can be a problem, since it's easy to include the extra top-level folder that it creates, ruining the XML. Instead, use WinZip or 7Zip to rezip. Here's my introductory article about OOXML hacking: OOXML Hacking: An Introduction

Upvotes: 1

Related Questions