VBA construct

C

Chris Watts

I am working on a macro (in PPT2000) and would welcome some advice on a VBA
construct please
The macro writes two lines into a text box using:
..Text = "Line 1" & vbcrlf & vbcrlf & "Line 2"

That works just fine, but I wish the second line to be different by being
italic or another colour.
If I precede it with the line
..Font.Italic = True
then this makes both lines italic. How can I do it for just the second
line - every attempt that I have tried results in Line 1 of the text being
overwritten and Line 2 only appearing in the box!

TIA
Chris
 
J

John Wilson

I don't have 2000 handy right now but this should work I think:

With ActivePresentation.Slides(1).Shapes(3).TextFrame.TextRange
..Text = "Line 1" & vbCrLf & vbCrLf & "Line 2"
..Lines(3).Font.Italic = msoTrue' note your line 2 is on line 3!
End with
--

john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
 
S

Shyam Pillai

Chris,

With ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange
.Text = "Line 1" & vbCrLf & vbCrLf
With .InsertAfter
.Text = "Line 2"
.Font.Italic = msoCTrue
End With
End With

Regards,
Shyam Pillai


Animation Carbon: http://animationcarbon.com
 

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