Get Normal Font Style in PowerPoint
I'm trying to check a presentation for the fonts that exist in it. This can be done with ActivePresentation.Fonts
. I also want to check if the font is normal, bold and/or italic. Bold and Italic are easy, but Normal is not. For example, say I have two text boxes, one of them has "Hello World" in Arial Italic and another the same in Arial Bold. The following code tells me I have both of these:
Sub CheckFonts()
Dim p As Presentation: Set p = ActivePresentation
Dim f As Font: S开发者_运维百科et f = p.Fonts(1)
Dim italic As Boolean: italic = f.italic
Dim bold As Boolean: bold = f.bold
Debug.Print "Bold in use: " & bold; vbTab & "Italic in use: " & italic
End Sub
Now let's assume I have one of the textboxes without Italic, but instead it is just normal Arial font. Without looping through every single font object in all shapes, is there anyway I can tell that it is a normal font (i.e. no formatting of italic/bold applied) from Presentation.Fonts
?
Thx in advance.
Sorry this is not an answer, but too funny to not pass on. During my little research for your Fonts problem I came upon the MSDN reference page for the Fonts object.
Apparently someone at Microsoft works for Genigraphics or someone copied documentation from some other product...
Here the excerpt preserved for eternity:
The Fonts collection is used by the Geni Wizard to determine whether any of the fonts in the specified presentation won't be supported when Genigraphics images the slides. If you just want to set character formatting for a particular bullet or text range, use the Font property to return the Font object for the bullet or text range.
The Genigraphics wizard enables users to transmit their presentations directly to Genigraphics for conversion into film slides, overhead transparencies, or other specialized media formats. For more information about the services Genigraphics provides, visit the Genigraphics Web site. This service may not be available outside the United States.
What the hell is that text doing on MSDN? :-)
精彩评论