why VBA dosn't recognize all the fonts?

E

Edward

Hi everybody,
Im wrting a vba code to check font names in my presentation and see if they
match allowable fonts but for some reason VBA can't recognize all the fonts ,
somthing that never happened in word VBA!


Dim oSld As Slide
Dim oShp As Shape

For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.HasTextFrame Then
If oShp.TextFrame.HasText Then
ilast=oshp.textframe.textrange.words.count
for iindex=1 to ilast
if oshp.textframe.textrange.words(iindex).font.name="Gothic"
then
' do somthing
end if
next
End If
End If
Next oShp
Next oSld
 
E

Edward

Thanks steve, I use PPT 2003 but apparently as you mentioned 2007 has the
same issue too. I tried to use debug.print and print font names in different
textplace holders and guess what ! it just printed blank for some fonts and
printed the correct name for the rest ! . I came up with a soulution which
seems to work at least for now I added a userform with some lables which does
word count and some extra stuff and copied each words font name to a lable's
font name and compared that name with my target font name and so far it does
the comparision correctly something that failed when I tried to do in VBA
directly !!
 
E

Edward

Thanks Steve . I was very careful not to apply several fonts to each word but
I will use your suggestions , Thanks again for your time and great help :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top