VBA Code

AutoLayouts on a slide (Slide Title and Subtitle) are Rectangles and not Text boxes
You cannot rename the shapes on the slide masters as a unique box is created every time !!



Number of Paragraphs in a Textbox

Application.ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Paragraphs.Count 


Indentation


Return Indent Level for a specific paragraph

With Application.ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Paragraphs(Start:=iParagraphNo, Length:=0) 
   .IndentLevel
End With

Define the indentation level for a paragraph

With Application.ActivePresentation.Slides(iSlideIndex). _ 
        Shapes(Application.ActiveWindow.Selection.ShapeRange.Name).TextFrame.Ruler
   .Levels(1).FirstMargin = sngLevel1First
   .Levels(1).LeftMargin = sngLevel1Left
End With


Dim icurrentslide As Integer 
Dim iaddslide As Integer
Dim objshape As Shape
Dim sShapeName As String

    icurrentslide = Application.ActiveWindow.Selection.SlideRange.SlideNumber
    iaddslide = Application.ActivePresentation.Slides.Add(Index:=icurrentslide + 1, Layout:=PpSlideLayout.ppLayoutText).SlideIndex
    Application.ActiveWindow.View.GotoSlide (iaddslide)
    Application.Activate
    Set objshape = Application.ActivePresentation.Slides(iaddslide).Shapes(2)
    objshape.TextFrame.TextRange.Text = "some text"
    objshape.Copy
    Application.ActiveWindow.View.GotoSlide (icurrentslide)
    Application.ActiveWindow.View.Paste
    sShapeName = Application.ActiveWindow.Selection.ShapeRange.Name
    Set objshape = Application.ActivePresentation.Slides(icurrentslide).Shapes(sShapeName)
    Application.ActiveWindow.View.GotoSlide (iaddslide)
    Application.ActiveWindow.Selection.SlideRange.Delete
    Application.ActiveWindow.View.GotoSlide (icurrentslide)
    objshape.Top = 100
    objshape.Left = 300
    objshape.Width = 300
    objshape.Height = 100

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext