How to remove references to a font that cannot be embedded in PowerPoint, programmatically?

I received a presentation recently that was saved with embedded fonts but wouldn't save due to one un-embeddable font:
PowerPoint cannot save fonts dialogI used the Replace Fonts tool in PowerPoint to try to get rid of this font reference but it didn't work:
PowerPoint Replace Fonts dialogInterestingly, VBA reports that there are just 3 fonts in use in the file, none of which are the troublesome font, as per this Immediate pane entry
?ActivePresentation.Fonts.Count
 3 
?ActivePresentation.Fonts(1).Name
Titillium Web
?ActivePresentation.Fonts(2).Name
Titillium WebLight
?ActivePresentation.Fonts(3).Name
Calibri

Open in new window


Having narrowed down a single textbox object that was causing this issue, I then looked at the 5 x font name properties of the shape using VBA:

.Name = "Titillium Web"
.NameAscii = "Titillium Web"
.NameComplexScript = "Titillium WebRegular"
.NameFarEast = "+mn-ea"
.NameOther = "Titillium Web"

Ah ha. So, according to MSDN, the NameComplexScript property is Read/Write so all I need to do is change it from "Titillium WebRegular" to "Titillium Web" and the problem should be fixed?

No! This doesn't change the property and no error is raised:

.NameComplexScript = "Titillium Web"

Open in new window


So my questions are:

1. Why does PowerPoint report more fonts are in use than the API does (I know Arial is used by template bullets)
2. Why can't I write to the NameComplexScript property?
3. Is there any other way to eradicate the referencing of the troublesome font?
LVL 15
Jamie GarrochSenior Technical Consultant at BrightCarbonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DansDadUKCommented:
I don't know the answer (I rarely use PowerPoint) - I'd just guess that Titillium WebRegular is perhaps just referring to the Regular variant (as opposed to the Bold, Italic or Bold-italic variants) of the Titillium Web font family?
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi Jamie,

Font.NameComplexScript  should be read/write.
https://msdn.microsoft.com/en-us/VBA/powerpoint-vba/articles/font-namecomplexscript-property-powerpoint

Try
PowerPoint Options > Save > UNcheck: Embed fonts in the file

If that doesn't work, try this:
copy the text to NotePad or somewhere else temporarily. Delete the textbox. Maybe even save and close ppt. Then open and create a replacement textbox.

If that still doesn't work ... create a new presentation. Apply the 'theme' from the presentation that is misbehaving. Open it too. Size windows so you can see both presentations. Drag the slides from one presentation to the other. You can drag from the navigation pane or the slide sorter view.

Perhaps the issue is network permissions ... what happens if you copy the file to your local drive and try to change it there?

have an awesome day,
crystal
Jamie GarrochSenior Technical Consultant at BrightCarbonAuthor Commented:
Thanks Crystal. I'm unable to use the suggested method to disable saving of fonts as it's a requirement in this template. What isn;t a requirement is the use of the erroneous font which I'm trying to replace programmatically. It occurs in multiple objects across multiple presentations hence the need for a programmatic solution. I discovered that I can write to the NameComplexScript property but only certain fonts are accepted e.g "Arial" and oddly, once I have changed that property to Arial, I can;t change it back to what it was before. So there is something happening behind the scenes to validate the attempt to write to the property, without and error raised for an invalid choice.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi Jamie,

hmmm. how about this:

backup the file
edit the file and DON'T embed fonts
make sure all references to the bad font are gone
save
close
close ppt  too -- just to be on the safe side; this shouldn't be necessary
open file again, edit fonts as desired, and choose to embed fonts
save
close

Is the bad font gone?

have an awesome day,
crystal
Jamie GarrochSenior Technical Consultant at BrightCarbonAuthor Commented:
The save option to embed fonts in the file or not doesn't affect the properties of the shape in question. I tried the suggestion and the font name properties remain the same as below:

.Name = Titillium Web
.NameAscii = Titillium Web
.NameComplexScript = Titillium WebRegular
.NameFarEast = +mn-ea
.NameOther = Titillium Web

Open in new window

crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi Jamie,

create the object again, copy properties you want, then delete the old control, then rename new one to old name if desired.

have an awesome day,
crystal

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jamie GarrochSenior Technical Consultant at BrightCarbonAuthor Commented:
It's not a technical workaround I really want to deal with as it leads to many more complications but without any other solution, I've closed the question.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.