VBA: Remove special indentation (hanging indent)

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).

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?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top