A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Change font of part of text



 
 
Thread Tools Display Modes
  #1  
Old March 14th, 2005, 02:40 PM
John
external usenet poster
 
Posts: n/a
Default Change font of part of text

Hi there,

I've got a procedure that runs through the textboxes (msoAutoShape) on each
slide and changes them to Arial 12. What I'd also like to do is to then run
through each paragraph in each textbox and change the headline text (up to
the hyphen) to Arial 14. There's usually about four paragraphs per textbox
with one blank line between each paragraph. Can anyone suggest how I should
go about this?

The format is as below:

Thanks

John



Headline Text Headline Text Headline Text Headline Text - body text body
text body text body text body text body text body text body text body text
body text body text body text body text body text body text body text body
text body text body text body text body text body text body text body text
body text body text body text body text body text body text.

Headline Text Headline Text Headline Text Headline Text - body text body
text body text body text body text body text body text body text body text
body text body text body text body text body text body text body text body
text body text body text body text body text body text body text body text
body text body text body text body text body text body text.

Headline Text Headline Text Headline Text Headline Text - body text body
text body text body text body text body text body text body text body text
body text body text body text body text body text body text body text body
text body text body text body text body text body text body text body text
body text body text body text body text body text body text.

Headline Text Headline Text Headline Text Headline Text - body text body
text body text body text body text body text body text body text body text
body text body text body text body text body text body text body text body
text body text body text body text body text body text body text body text
body text body text body text body text body text body text.


  #2  
Old March 14th, 2005, 03:47 PM
David M. Marcovitz
external usenet poster
 
Posts: n/a
Default

This code is set to do shape 2 on the current slide, but you can copy the
guts of it into your current loop as you go from shape to shape. In fact
the only thing you should have to change is the With line (since you are
already messing with the text in the shape, I assume you already checked
in your code to be sure the shape has a textframe; if not, add a check
for that):

Sub EnlargeHeading()
Dim myPar As TextRange
Dim dashRange As TextRange
Dim endLarge As Long
With ActivePresentation.SlideShowWindow.View.Slide.Shap es(2)
For Each myPar In .TextFrame.TextRange.Paragraphs
Set dashRange = myPar.Find("-")
If dashRange Is Nothing Then
endLarge = 0
Else
endLarge = dashRange.Start - myPar.Start
End If
MsgBox endLarge
myPar.Characters(1, endLarge).Font.Size = 16
Next myPar
End With
End Sub

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

"John" wrote in
:

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.


  #3  
Old March 14th, 2005, 03:49 PM
David M. Marcovitz
external usenet poster
 
Posts: n/a
Default

Oh, one more thing. Cut out the msgBox line. That was just to help figure
it out.
--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

"John" wrote in
:

Hi there,

I've got a procedure that runs through the textboxes (msoAutoShape) on
each slide and changes them to Arial 12. What I'd also like to do is
to then run through each paragraph in each textbox and change the
headline text (up to the hyphen) to Arial 14. There's usually about
four paragraphs per textbox with one blank line between each
paragraph. Can anyone suggest how I should go about this?

The format is as below:

Thanks

John



Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.



  #4  
Old March 14th, 2005, 03:50 PM
David M. Marcovitz
external usenet poster
 
Posts: n/a
Default

Oh, one more thing. Cut out the msgBox line. That was just to help figure
it out.
--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

"John" wrote in
:

Hi there,

I've got a procedure that runs through the textboxes (msoAutoShape) on
each slide and changes them to Arial 12. What I'd also like to do is
to then run through each paragraph in each textbox and change the
headline text (up to the hyphen) to Arial 14. There's usually about
four paragraphs per textbox with one blank line between each
paragraph. Can anyone suggest how I should go about this?

The format is as below:

Thanks

John



Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.



  #5  
Old March 14th, 2005, 05:51 PM
John
external usenet poster
 
Posts: n/a
Default

Hi David,

Thanks very much for the help. It does the job perfectly. One issue I've
come up with is that in certain cases, the appear to be "long dashes" as
opposed to normal short dashes. I've added the two possibilities (using
txtHyphen), but it still doesn't appear to find the "em dash" (at least
I've discovered that much!).

(I also discovered that if there is another dash later in the paragraph and
a "long dash" in the correct place it skips the "long dash" and formats the
lot up to the secondary dash, so...I've included a test to find the small
number.)

Now I guess that the problem is either a) that the "long dash" is not an em
dash at all (in which case, what is it?) and so that's why it isn't being
picked up, or b) there's still something I'm not doing correctly. Can you
tell from the code which it is?

Thanks again

John

Sub FormatTextShapes()

Dim shp As Shape
Dim txtPara As TextRange
Dim txtDash As TextRange
Dim txtHyphen As TextRange
Dim endLarge As Long
Dim stSld As Integer 'start slide for procedure

stSld = InputBox("Enter start slide number:" & vbCr & _
"(ie don't include summary sheets).", "Start Slide", "4")

For x = stSld To ActivePresentation.Slides.Count
For Each shp In ActivePresentation.Slides(x).Shapes
Debug.Print x
If shp.HasTextFrame = msoTrue Then
If shp.Width 600 And shp.Height 375 And shp.Type = 1
Then
With shp
.Fill.Transparency = 0#
.Left = 15.75
.Top = 85.75
.Width = 660#
With .TextFrame.TextRange
With .ParagraphFormat
.Alignment = ppAlignJustify
.SpaceWithin = 1
.SpaceBefore = 0
.SpaceAfter = 0
End With
With .Font
.Name = "Arial"
.Size = 12
End With
End With
End With
For Each txtPara In shp.TextFrame.TextRange.Paragraphs
Set txtDash = txtPara.Find(Chr(45)) '"-")
Set txtHyphen = txtPara.Find(Chr(151)) '"-")
'If both dash and hyphen found check which is smaller
If Not txtDash Is Nothing And Not txtHyphen Is Nothing
Then
If txtDash txtHyphen Then
endLarge = txtDash.Start - txtPara.Start
Else
endLarge = txtHyphen.Start - txtPara.Start
End If
'If hyphen only found
ElseIf txtDash Is Nothing And Not txtHyphen Is Nothing
Then
endLarge = txtHyphen.Start - txtPara.Start
'If dash only found
ElseIf txtHyphen Is Nothing And Not txtDash Is Nothing
Then
endLarge = txtDash.Start - txtPara.Start
'If neither dash nor hyphen found
Else
endLarge = 0
End If
txtPara.Characters(1, endLarge).Font.Size = 18
Next txtPara
End If
End If
Next shp
Next x
End Sub


"David M. Marcovitz" wrote in message
48.16...
This code is set to do shape 2 on the current slide, but you can copy the
guts of it into your current loop as you go from shape to shape. In fact
the only thing you should have to change is the With line (since you are
already messing with the text in the shape, I assume you already checked
in your code to be sure the shape has a textframe; if not, add a check
for that):

Sub EnlargeHeading()
Dim myPar As TextRange
Dim dashRange As TextRange
Dim endLarge As Long
With ActivePresentation.SlideShowWindow.View.Slide.Shap es(2)
For Each myPar In .TextFrame.TextRange.Paragraphs
Set dashRange = myPar.Find("-")
If dashRange Is Nothing Then
endLarge = 0
Else
endLarge = dashRange.Start - myPar.Start
End If
MsgBox endLarge
myPar.Characters(1, endLarge).Font.Size = 16
Next myPar
End With
End Sub

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

"John" wrote in
:

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.




  #6  
Old March 14th, 2005, 06:10 PM
John
external usenet poster
 
Posts: n/a
Default

Ok, just discovered the answer.......it turns out there is also an "en dash"
(as well as an "em dash"), which is Chr(150) not 151.

Also discovered, for anyone whose interested, that to avoid picking up the
dash in a word in the headline part that I needed to add the spaces either
side of it. ie(" " & Chr(150) & " ")

Anyway, thanks very much for your help David.

Best regards

John

"John" wrote in message
...
Hi David,

Thanks very much for the help. It does the job perfectly. One issue I've
come up with is that in certain cases, there appears to be "long dashes"
as opposed to normal short dashes. I've added the two possibilities
(using txtHyphen), but it still doesn't appear to find the "em dash" (at
least I've discovered that much!).

(I also discovered that if there is another dash later in the paragraph
and a "long dash" in the correct place it skips the "long dash" and
formats the lot up to the secondary dash, so...I've included a test to
find the smaller number.)

Now I guess that the problem is either a) that the "long dash" is not an
em dash at all (in which case, what is it?) and so that's why it isn't
being picked up, or b) there's still something I'm not doing correctly.
Can you tell from the code which it is?

Thanks again

John

Sub FormatTextShapes()

Dim shp As Shape
Dim txtPara As TextRange
Dim txtDash As TextRange
Dim txtHyphen As TextRange
Dim endLarge As Long
Dim stSld As Integer 'start slide for procedure

stSld = InputBox("Enter start slide number:" & vbCr & _
"(ie don't include summary sheets).", "Start Slide", "4")

For x = stSld To ActivePresentation.Slides.Count
For Each shp In ActivePresentation.Slides(x).Shapes
Debug.Print x
If shp.HasTextFrame = msoTrue Then
If shp.Width 600 And shp.Height 375 And shp.Type = 1
Then
With shp
.Fill.Transparency = 0#
.Left = 15.75
.Top = 85.75
.Width = 660#
With .TextFrame.TextRange
With .ParagraphFormat
.Alignment = ppAlignJustify
.SpaceWithin = 1
.SpaceBefore = 0
.SpaceAfter = 0
End With
With .Font
.Name = "Arial"
.Size = 12
End With
End With
End With
For Each txtPara In shp.TextFrame.TextRange.Paragraphs
Set txtDash = txtPara.Find(Chr(45)) '"-")
Set txtHyphen = txtPara.Find(Chr(151)) '"-")
'If both dash and hyphen found check which is smaller
If Not txtDash Is Nothing And Not txtHyphen Is Nothing
Then
If txtDash txtHyphen Then
endLarge = txtDash.Start - txtPara.Start
Else
endLarge = txtHyphen.Start - txtPara.Start
End If
'If hyphen only found
ElseIf txtDash Is Nothing And Not txtHyphen Is Nothing
Then
endLarge = txtHyphen.Start - txtPara.Start
'If dash only found
ElseIf txtHyphen Is Nothing And Not txtDash Is Nothing
Then
endLarge = txtDash.Start - txtPara.Start
'If neither dash nor hyphen found
Else
endLarge = 0
End If
txtPara.Characters(1, endLarge).Font.Size = 18
Next txtPara
End If
End If
Next shp
Next x
End Sub


"David M. Marcovitz" wrote in message
48.16...
This code is set to do shape 2 on the current slide, but you can copy the
guts of it into your current loop as you go from shape to shape. In fact
the only thing you should have to change is the With line (since you are
already messing with the text in the shape, I assume you already checked
in your code to be sure the shape has a textframe; if not, add a check
for that):

Sub EnlargeHeading()
Dim myPar As TextRange
Dim dashRange As TextRange
Dim endLarge As Long
With ActivePresentation.SlideShowWindow.View.Slide.Shap es(2)
For Each myPar In .TextFrame.TextRange.Paragraphs
Set dashRange = myPar.Find("-")
If dashRange Is Nothing Then
endLarge = 0
Else
endLarge = dashRange.Start - myPar.Start
End If
MsgBox endLarge
myPar.Characters(1, endLarge).Font.Size = 16
Next myPar
End With
End Sub

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

"John" wrote in
:

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.






  #7  
Old March 14th, 2005, 08:53 PM
Steve Rindsberg
external usenet poster
 
Posts: n/a
Default

In article , John wrote:
Ok, just discovered the answer.......it turns out there is also an "en dash"
(as well as an "em dash"), which is Chr(150) not 151.


To simplify things, and assuming you're using PPT2000 or higher, consider using
Replace a couple times before running the other code here.

Decide what character you want to use for the dash then use Replace to replace
other variants with your desired character:

Function NormalizeDashes(sTemp as String) as String

sTemp = Replace(sTemp, " -- ", " " & Chr(150) & " ")
sTemp = Replace(sTemp, " " & chr(151) & " ", " " & Chr(150) & " ")
' etc
NormalizeDashes = sTemp

End Function


Also discovered, for anyone whose interested, that to avoid picking up the
dash in a word in the headline part that I needed to add the spaces either
side of it. ie(" " & Chr(150) & " ")

Anyway, thanks very much for your help David.

Best regards

John

"John" wrote in message
...
Hi David,

Thanks very much for the help. It does the job perfectly. One issue I've
come up with is that in certain cases, there appears to be "long dashes"
as opposed to normal short dashes. I've added the two possibilities
(using txtHyphen), but it still doesn't appear to find the "em dash" (at
least I've discovered that much!).

(I also discovered that if there is another dash later in the paragraph
and a "long dash" in the correct place it skips the "long dash" and
formats the lot up to the secondary dash, so...I've included a test to
find the smaller number.)

Now I guess that the problem is either a) that the "long dash" is not an
em dash at all (in which case, what is it?) and so that's why it isn't
being picked up, or b) there's still something I'm not doing correctly.
Can you tell from the code which it is?

Thanks again

John

Sub FormatTextShapes()

Dim shp As Shape
Dim txtPara As TextRange
Dim txtDash As TextRange
Dim txtHyphen As TextRange
Dim endLarge As Long
Dim stSld As Integer 'start slide for procedure

stSld = InputBox("Enter start slide number:" & vbCr & _
"(ie don't include summary sheets).", "Start Slide", "4")

For x = stSld To ActivePresentation.Slides.Count
For Each shp In ActivePresentation.Slides(x).Shapes
Debug.Print x
If shp.HasTextFrame = msoTrue Then
If shp.Width 600 And shp.Height 375 And shp.Type = 1
Then
With shp
.Fill.Transparency = 0#
.Left = 15.75
.Top = 85.75
.Width = 660#
With .TextFrame.TextRange
With .ParagraphFormat
.Alignment = ppAlignJustify
.SpaceWithin = 1
.SpaceBefore = 0
.SpaceAfter = 0
End With
With .Font
.Name = "Arial"
.Size = 12
End With
End With
End With
For Each txtPara In shp.TextFrame.TextRange.Paragraphs
Set txtDash = txtPara.Find(Chr(45)) '"-")
Set txtHyphen = txtPara.Find(Chr(151)) '"-")
'If both dash and hyphen found check which is smaller
If Not txtDash Is Nothing And Not txtHyphen Is Nothing
Then
If txtDash txtHyphen Then
endLarge = txtDash.Start - txtPara.Start
Else
endLarge = txtHyphen.Start - txtPara.Start
End If
'If hyphen only found
ElseIf txtDash Is Nothing And Not txtHyphen Is Nothing
Then
endLarge = txtHyphen.Start - txtPara.Start
'If dash only found
ElseIf txtHyphen Is Nothing And Not txtDash Is Nothing
Then
endLarge = txtDash.Start - txtPara.Start
'If neither dash nor hyphen found
Else
endLarge = 0
End If
txtPara.Characters(1, endLarge).Font.Size = 18
Next txtPara
End If
End If
Next shp
Next x
End Sub


"David M. Marcovitz" wrote in message
48.16...
This code is set to do shape 2 on the current slide, but you can copy the
guts of it into your current loop as you go from shape to shape. In fact
the only thing you should have to change is the With line (since you are
already messing with the text in the shape, I assume you already checked
in your code to be sure the shape has a textframe; if not, add a check
for that):

Sub EnlargeHeading()
Dim myPar As TextRange
Dim dashRange As TextRange
Dim endLarge As Long
With ActivePresentation.SlideShowWindow.View.Slide.Shap es(2)
For Each myPar In .TextFrame.TextRange.Paragraphs
Set dashRange = myPar.Find("-")
If dashRange Is Nothing Then
endLarge = 0
Else
endLarge = dashRange.Start - myPar.Start
End If
MsgBox endLarge
myPar.Characters(1, endLarge).Font.Size = 16
Next myPar
End With
End Sub

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

"John" wrote in
:

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.






-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


  #8  
Old March 15th, 2005, 11:10 AM
John
external usenet poster
 
Posts: n/a
Default

Ah yes, this is a much better solution. Thanks Steve.

John

"Steve Rindsberg" wrote in message
...
In article , John wrote:
Ok, just discovered the answer.......it turns out there is also an "en
dash"
(as well as an "em dash"), which is Chr(150) not 151.


To simplify things, and assuming you're using PPT2000 or higher, consider
using
Replace a couple times before running the other code here.

Decide what character you want to use for the dash then use Replace to
replace
other variants with your desired character:

Function NormalizeDashes(sTemp as String) as String

sTemp = Replace(sTemp, " -- ", " " & Chr(150) & " ")
sTemp = Replace(sTemp, " " & chr(151) & " ", " " & Chr(150) & " ")
' etc
NormalizeDashes = sTemp

End Function


Also discovered, for anyone whose interested, that to avoid picking up
the
dash in a word in the headline part that I needed to add the spaces
either
side of it. ie(" " & Chr(150) & " ")

Anyway, thanks very much for your help David.

Best regards

John

"John" wrote in message
...
Hi David,

Thanks very much for the help. It does the job perfectly. One issue
I've
come up with is that in certain cases, there appears to be "long
dashes"
as opposed to normal short dashes. I've added the two possibilities
(using txtHyphen), but it still doesn't appear to find the "em dash"
(at
least I've discovered that much!).

(I also discovered that if there is another dash later in the paragraph
and a "long dash" in the correct place it skips the "long dash" and
formats the lot up to the secondary dash, so...I've included a test to
find the smaller number.)

Now I guess that the problem is either a) that the "long dash" is not
an
em dash at all (in which case, what is it?) and so that's why it isn't
being picked up, or b) there's still something I'm not doing correctly.
Can you tell from the code which it is?

Thanks again

John

Sub FormatTextShapes()

Dim shp As Shape
Dim txtPara As TextRange
Dim txtDash As TextRange
Dim txtHyphen As TextRange
Dim endLarge As Long
Dim stSld As Integer 'start slide for procedure

stSld = InputBox("Enter start slide number:" & vbCr & _
"(ie don't include summary sheets).", "Start Slide", "4")

For x = stSld To ActivePresentation.Slides.Count
For Each shp In ActivePresentation.Slides(x).Shapes
Debug.Print x
If shp.HasTextFrame = msoTrue Then
If shp.Width 600 And shp.Height 375 And shp.Type = 1
Then
With shp
.Fill.Transparency = 0#
.Left = 15.75
.Top = 85.75
.Width = 660#
With .TextFrame.TextRange
With .ParagraphFormat
.Alignment = ppAlignJustify
.SpaceWithin = 1
.SpaceBefore = 0
.SpaceAfter = 0
End With
With .Font
.Name = "Arial"
.Size = 12
End With
End With
End With
For Each txtPara In shp.TextFrame.TextRange.Paragraphs
Set txtDash = txtPara.Find(Chr(45)) '"-")
Set txtHyphen = txtPara.Find(Chr(151)) '"-")
'If both dash and hyphen found check which is
smaller
If Not txtDash Is Nothing And Not txtHyphen Is
Nothing
Then
If txtDash txtHyphen Then
endLarge = txtDash.Start - txtPara.Start
Else
endLarge = txtHyphen.Start - txtPara.Start
End If
'If hyphen only found
ElseIf txtDash Is Nothing And Not txtHyphen Is
Nothing
Then
endLarge = txtHyphen.Start - txtPara.Start
'If dash only found
ElseIf txtHyphen Is Nothing And Not txtDash Is
Nothing
Then
endLarge = txtDash.Start - txtPara.Start
'If neither dash nor hyphen found
Else
endLarge = 0
End If
txtPara.Characters(1, endLarge).Font.Size = 18
Next txtPara
End If
End If
Next shp
Next x
End Sub


"David M. Marcovitz" wrote in message
48.16...
This code is set to do shape 2 on the current slide, but you can copy
the
guts of it into your current loop as you go from shape to shape. In
fact
the only thing you should have to change is the With line (since you
are
already messing with the text in the shape, I assume you already
checked
in your code to be sure the shape has a textframe; if not, add a check
for that):

Sub EnlargeHeading()
Dim myPar As TextRange
Dim dashRange As TextRange
Dim endLarge As Long
With ActivePresentation.SlideShowWindow.View.Slide.Shap es(2)
For Each myPar In .TextFrame.TextRange.Paragraphs
Set dashRange = myPar.Find("-")
If dashRange Is Nothing Then
endLarge = 0
Else
endLarge = dashRange.Start - myPar.Start
End If
MsgBox endLarge
myPar.Characters(1, endLarge).Font.Size = 16
Next myPar
End With
End Sub

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

"John" wrote in
:

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.

Headline Text Headline Text Headline Text Headline Text - body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text body text body text body text body text body text body text
body text.






-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access reports with a horizontal line after each record??? Bill via AccessMonster.com Setting Up & Running Reports 6 March 9th, 2005 05:51 PM
Change text box values as tab through datasheet etalent Using Forms 0 February 9th, 2005 01:53 AM
Outline Renee Hendershott Page Layout 2 December 25th, 2004 03:49 PM
Can I change the font color of text inside an IF statement? Craig_I General Discussion 1 October 25th, 2004 02:55 PM
How do I change the default font color when pasting text into an . Cooker General Discussion 1 September 8th, 2004 10:47 PM


All times are GMT +1. The time now is 06:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.