I need to create a custom textbox in the active slide with set text, font type, font size, font colour, and bold and italics feature in Powerpoint 2007 using a macro.
I am currently using this code:
Sub InsertTextBox()
Set myDocument = ActivePresentation.Slides(1)
Set newTextBox = myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, _
100, Top:=100, Width:=541.44, Height:=43.218)
With newTextBox.TextFrame.TextRange
.Text = "Slide Title"
.Font.Size = 24
.Font.Name = "Arial"
.Font.Colour = RGB(107, 107, 107)
End With
End Sub
Its throwing an exception in .Font.Colour saying that this property is not associated with the object. Also i need to incorporate a feature for bold and italics..Plz help me on this
.Font.Color =is correct property. For bold use this one.Font.Bold = trueand for italic quite similar:.Font.Italic = true. - Kazimierz Jawor