Indent in section with several lines with WrapText = true

I have section with several lines. WrapText = true;
I would like to have indent by Parachraphs. Thus it must look.
1. Text…
Text
I cannot use BulletOffset because the Text have none “\r”.
If there is other way?

Thanks.
Sven.



Hello,

I think; it is possible if you set textoffset 0. I will soon provide you a code example, how to achieve it.

Hello,

You can make the text appear at the same distance from left line of the textframe by setting the text offset property to some value and bullet offset property to 0 as shown in the code below.

Please see the output presentation of this code also.

C#

//Create a new presentation
Presentation pres = new Presentation();

//Get first slide
Slide sld = pres.GetSlideByPosition(1);

//Add a rectangle with some dimensions i.e X, Y, Width, Height
Aspose.Slides.Shape shp = sld.Shapes.AddRectangle(100, 100, 3000, 1);

//Add a textframe inside a shape
TextFrame tf = shp.AddTextFrame("");

//Set wrap text true, so that text is wrapped
//if it exceeds the textframe width
tf.WrapText = true;

//Set fit shape to text true, so that it can grow
//if text exceeds the textframe height
tf.FitShapeToText = true;

//Access the first paragraph
Paragraph para = tf.Paragraphs[0];

//Set paragraph has numbered bullet type
para.HasBullet = true;
para.BulletType = BulletType.Numbered;

//This is an offset of bullet from the left line
//of textframe's rectangle
para.BulletOffset = 0;

//This is an offset of text from the left line
//of textframe's rectangle
para.TextOffset = 200;

//Access its portion to set text
Portion port = para.Portions[0];

//Set sample text
port.Text = "This is a paragraph. This is a part of paragraph. This is still another part of paragraph.";

//Just for illustration, create the copy
//of the above paragraph and add again
para = new Paragraph(para);
tf.Paragraphs.Add(para);

//Reset Y position of the rectangle
//because when textframe will grow automatically, the Y position
//will not remain the same we set earlier
int y = shp.Y;
shp.Y = 100;

//Write the presentation in output directory.
pres.Write(OUTDIR + "output.ppt");

Many Thanks!!!