WrapText

TextFrameFormat.WrapText 属性

如果文本在TextFrame的边距处换行,则为True。可读/写 NullableBool

public NullableBool WrapText { get; set; }

示例

以下示例代码演示了如何在演示文稿中换行文本。

[C#]
using (Presentation pres = new Presentation())
{
    ISlide slide = pres.Slides[0];
    IAutoShape autoShape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 30, 30, 350, 100);
    Portion portion = new Portion("lorem ipsum...");
    portion.PortionFormat.FillFormat.SolidFillColor.Color = Color.Black;
    portion.PortionFormat.FillFormat.FillType = FillType.Solid;
    autoShape.TextFrame.Paragraphs[0].Portions.Add(portion);
    ITextFrameFormat textFrameFormat = autoShape.TextFrame.TextFrameFormat;
    textFrameFormat.WrapText = NullableBool.True;
    pres.Save("Output-presentation.pptx", SaveFormat.Pptx);
}

另请参见