Question

I'm taking some user data and adding it to a PowerPoint presentation using VSTO. To get the formatting to look right, though I need to be able to set the left margin of some of the text in the textbox. There will be an initial block of text followed by another, indented block. For example (underlines added to emphasize spacing):

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vestibulum elementum neque id rhoncus. In fermentum eros nec dolor lobortis sit amet fermentum est consequat. Curabitur eleifend nunc eu odio vehicula ut elementum erat aliquam. Ut adipiscing ipsum sit amet leo pulvinar hendrerit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla non neque in velit lacinia tempor et a lacus.
___________Cras auctor bibendum urna, a facilisis lacus lacinia non.
___________Nullam at quam a mauris consequat vulputate sed eu sapien.
___________Fusce sed urna nulla, ut sagittis lacus. Pellentesque tortor
___________augue, scelerisque at aliquet a, pretium ac ipsum.

I can get this effect by setting Shape.TextFrame.TextRange.IndentLevel = 2 on the lower block of text. However, I cannot figure out how to programmatically set the value of the margin. Does anyone know how to do this?

Was it helpful?

Solution

This is taken care of via Shape.TextFrame.MarginRight and Shape.TextFrame.MarginLeft and the like.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top