PDA

View Full Version : [SOLVED:] INSERTING A PREFORMATTED BULLETED TEXT BOX



RayKay
01-02-2019, 03:48 AM
Hi John, sorry I've kept you so busy. This is the last one :think:, but I'm sure thousands of people would find this useful.

I'd like to have a button that when clicked inserts a Text box on the slide with 3 levels of bullets, I have this so far:



Sub NewTextBox()
Dim I As Integer

[????]

I = 1
For I = 1 To .TextRange2.Paragraphs.Count
With .TextRange2.Paragraphs(I)
Select Case .ParagraphFormat.IndentLevel
Case Is = 1
.ParagraphFormat.Alignment = ppAlignLeft
'NOTE The FirstLineIndent is essentially how far Behind the
'left indent the bullet appears. Usually it stays constant
' hard to understand at first
.ParagraphFormat.FirstLineIndent = -15
.ParagraphFormat.LeftIndent = 15
With .ParagraphFormat.Bullet
.Visible = msoCTrue
With .Font
.Name = "Wingdings"
.Fill.ForeColor.RGB = RGB(219, 0, 17)
End With
.Character = 167
End With
Case Is = 2
.ParagraphFormat.Alignment = ppAlignLeft
.ParagraphFormat.FirstLineIndent = -15
.ParagraphFormat.LeftIndent = 30
With .ParagraphFormat.Bullet
.Visible = msoCTrue
With .Font
.Name = "Arial"
.Fill.ForeColor.RGB = RGB(219, 0, 17)
End With
.Character = 8211
End With
Case Is = 3
.ParagraphFormat.Alignment = ppAlignLeft
.ParagraphFormat.FirstLineIndent = -15
.ParagraphFormat.LeftIndent = 45
With .ParagraphFormat.Bullet
.Visible = msoCTrue
With .Font
.Name = "Wingdings"
.Fill.ForeColor.RGB = RGB(219, 0, 17)
End With
.Character = 167
.RelativeSize = 0.9
End With
End Select
End With
Next I
End If
End With
End Sub

THANK YOU

John Wilson
01-02-2019, 06:59 AM
you can only preformat Placeholders. With a normal TextBox you can only format existing text.

We often program TextBoxes and tables with programmed levels for big customers but the solution is very complicated and involves hacking into the increase/decrease level command. It would be hard to explain and in any case I don'rt want to share the solution as we charge mega bucks for it!

RayKay
01-02-2019, 07:07 AM
Hi John, totally understand!! Would be crazy to release secrets. Thanks for all your help :) Forever grateful. Have a great 2019