简体   繁体   中英

PPTX OpenXML - Which is the newline indicator in bulleted text?

Can you please help me identify which is the newline indicator in bulleted text in PPTX OpenXML ? based on this I want add newline character in my program

-Thank you

Use the Break Class

So for the following slide with bulleted list with a newline indicator:

在此处输入图片说明

Refer to the follwing code snipping showing from third bullet to fourth:

        using DocumentFormat.OpenXml.Presentation;
        using DocumentFormat.OpenXml;
        using A = DocumentFormat.OpenXml.Drawing;

...

        A.Run run3 = new A.Run();
        A.RunProperties runProperties3 = new A.RunProperties(){ Language = "en-US", Dirty = false, SpellingError = true, SmartTagClean = false };
        A.Text text3 = new A.Text();
        text3.Text = "Th";

        run3.Append(runProperties3);
        run3.Append(text3);

        A.Run run4 = new A.Run();
        A.RunProperties runProperties4 = new A.RunProperties(){ Language = "en-US", Dirty = false, SmartTagClean = false };
        A.Text text4 = new A.Text();
        text4.Text = "";

        run4.Append(runProperties4);
        run4.Append(text4);

        A.Break break1 = new A.Break();
        A.RunProperties runProperties5 = new A.RunProperties(){ Language = "en-US", Dirty = false, SmartTagClean = false };

        break1.Append(runProperties5);

        A.Run run5 = new A.Run();
        A.RunProperties runProperties6 = new A.RunProperties(){ Language = "en-US", Dirty = false, SpellingError = true, SmartTagClean = false };
        A.Text text5 = new A.Text();
        text5.Text = "ird";

        run5.Append(runProperties6);
        run5.Append(text5);
        A.EndParagraphRunProperties endParagraphRunProperties1 = new A.EndParagraphRunProperties(){ Language = "en-US", Dirty = false, SmartTagClean = false };

        paragraph3.Append(paragraphProperties3);
        paragraph3.Append(run3);
        paragraph3.Append(run4);
        paragraph3.Append(break1);
        paragraph3.Append(run5);
        paragraph3.Append(endParagraphRunProperties1);

This code was generated with the Open XML Productivity Tool . I highly recommend you use it to reverse engineer the things you need to write code for in Excel, Word and PowerPoint.

Hope this helps...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM