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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
VBA construct
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 |
#2
|
|||
|
|||
VBA construct
I don't have 2000 handy right now but this should work I think:
With ActivePresentation.Slides(1).Shapes(3).TextFrame.T extRange ..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/powerpoi...tutorials.html "Chris Watts" wrote: 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 |
#3
|
|||
|
|||
VBA construct
Chris,
With ActivePresentation.Slides(1).Shapes(1).TextFrame.T extRange .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 "Chris Watts" wrote in message ... 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 |
#4
|
|||
|
|||
VBA construct
Thanks, Shyam and John.
Both work perfectly. cheers Chris "Shyam Pillai" wrote in message ... Chris, With ActivePresentation.Slides(1).Shapes(1).TextFrame.T extRange .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 "Chris Watts" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|