Reputation: 249
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
Upvotes: 1
Views: 1280
Reputation: 5951
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...
Upvotes: 1