Powerful PowerPoint for Educators: Using Visual Basic for Applications to Make PowerPoint Interactive


ActivePresentation.SlideShowWindow.View.Slide.Shapes(3)


Download 1.37 Mb.
Pdf ko'rish
bet80/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   76   77   78   79   80   81   82   83   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

ActivePresentation.SlideShowWindow.View.Slide.Shapes(3). _
TextFrame.TextRange.Char 
ac 
ters(2).Font.Color.RGB = vbBlue
Finally, any of these statements can be altered slightly to in clude a range of para-
graphs, words, or characters. Simply in clude a second num ber after the “2” to
tell how many paragraphs, words, or characters you want to af fect. For example,
if you want to make seven characters blue, starting with the second one, you
would use the following:
ActivePresentation.SlideShowWindow.View.Slide.Shapes(3). _
TextFrame.TextRange.Char 
acters(2,7).Font.Color.RGB = vbBlue
If the text is “Hello, mother,” then the characters “ello, m” would turn blue (the
comma and space count as the fifth and sixth char acters).
What Can You Change?
All of the examples above changed the color of the text using
.Font.Color.RGB
. This is one of many things that you can change about the
font of the text. You can change
Bold
,
Italic
,
Shadow
, and 
Un 
der 
line
to
True
or 
False
. For example:
ActivePresentation.SlideShowWindow.View.Slide.Shapes(3). _
TextFrame.TextRange.Font.Bold = True
This is the same as if you had selected the text and clicked on the Bold but ton in
the toolbar.
Ma nip u lat ing Text in Ob jects 83


You can also set the
Size
of the text to a par ticular point size. For ex ample, if
you wanted to change the text to a 12-point font size, you could use the fol lowing:
ActivePresentation.SlideShowWindow.View.Slide.Shapes(3). _
TextFrame.TextRange.Font.Size = 12
You can change the 
Name
of the font, but you should be ware; if this presen-
tation is run ning on a variety of computers, you should stay away from fonts that
are not standard because your font will only show up prop erly if the computer on 
which the presentation is run ning has the font. To change the font to Helvetica,
you can use the fol lowing example:

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   76   77   78   79   80   81   82   83   ...   191




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling