I am writing an AddIn PowerPoint. I am using PowerPoint 2013, C#, Visual Studio 2013.
When I open an existing presentation which is created and modified on another computer (e.g., Mac or Linux), some texts in non-standard true type fonts prevent me from saving the presentation.
<img alt="error" class="b-lazy" data-src="https://i.stack.imgur.com/scyl6.png" data-original="https://i.stack.imgur.com/scyl6.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />
So my question is
1) Is it possible to catch and handle this error in code?
2) Or is there any way to check whether a presentation contains some non-standard font?
Nothing's preventing you from saving the presentation as such; the message is telling you that because the presentation uses fonts that are not embeddable, you cannot save the presentation with the fonts embedded.
You can look at the presentation's .Fonts collection and determine for each font whether it's embeddable or not:
Sub FontList() Dim x As Long With ActivePresentation.Fonts For x = 1 To .Count Debug.Print .Item(x).Name & vbTab & .Item(x).Embeddable Next End With End Sub
If you find unembeddable fonts, you could opt to save the presentation w/o embedding fonts (third parameter to SaveAs set to False rather than True).
Or probably more practically, use the .Fonts.Replace to substitute a different font (one that IS embeddable). I expect you'd have to create your own replacement table for this; if the font's not present on your system, Windows will have substituted another font, but PPT won't tell you what font it is.