VBA_Noob123
New Member
- Joined
- May 27, 2019
- Messages
- 1
I have a slide in a PowerPoint presentation ("myPresentation") with some text in a shape. I want to add more text to this. In order to do this, I have stored the old text in a variable, wrote my new text and concatenated it with the variable (see below).
Problem is it left me with some indentations. I took care of part of the problem with this:
However, I still have some indents left (See this picture). I can fix it manually by setting Paragraph -> Indentation -> Special from "Hanging" to "None" (in this menu). But how do I do this with VBA, what is the right property?
Code:
myPresentation.Slides.InsertFromFile Filename:=Presentation2, Index:=myPresentation.Slides.Count - 1, SlideStart:=1, SlideEnd:=Presentation2.Slides.Count
old_text = myPresentation.Slides(myPresentation.Slides.Count - 1).Shapes(1).TextFrame.TextRange.Text
myPresentation.Slides(myPresentation.Slides.Count - 1).Shapes(1).TextFrame.TextRange.Text = "Hello," & vbNewLine & "some new text" & vbNewLine & old_text
Problem is it left me with some indentations. I took care of part of the problem with this:
Code:
myPresentation.Slides(myPresentation.Slides.Count - 1).Shapes(1).TextFrame.TextRange.IndentLevel = 1
However, I still have some indents left (See this picture). I can fix it manually by setting Paragraph -> Indentation -> Special from "Hanging" to "None" (in this menu). But how do I do this with VBA, what is the right property?