Paragraph Indent


I am using following applescript code to Left indent all paragraphs in slide 1.
But this code gives me error "


Can anyone help me on this.

tell application "Microsoft PowerPoint"
	tell slide 1 of active presentation
		tell text range of text frame of shape 1
			repeat with i from 1 to count of paragraphs
				set left indent of paragraph format of paragraph 1 to 5
			end repeat
		end tell
	end tell
end tell


I created a new Powerpoint presentation with one shape with a text field on the first slide, ran your script, and it worked fine.

So can’t help with what I’ve got to go on now, because I can’t recreate the error.

Can you post a link to a presentation I can download that’s giving you the error?

It seems that there is a typo.
I guess that the instruction :

set left indent of paragraph format of paragraph 1 to 5

must be :

set left indent of paragraph format of paragraph i to 5

Yvan KOENIG running High Sierra 10.13.5 in French (VALLAURIS, France) dimanche 24 juin 2018 10:21:44

Oh, that’s a good point. It worked on my test because I only bothered making one paragraph in my test document.

However, that typo would explain the result if the OP were getting only the first paragraph indented, but not all the rest. But he said he’s getting an error message… fixing the typo you noted should only fix it so all paragraphs get indented, not prevent an error message.


Thanks for the reply.

I am using Powerpoint 2011 Version on Mac OSx 10.9.5.
I am posting my file in this link


Can i get any help on this,


I downloaded your slide deck, ran the script with Yvan’s correction, and it worked perfectly.

So… sorry, I can’t recreate the error, I don’t know how to help.