Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PPTX - Finding out whether text is bulleted from OpenXML

I have not been able to find any indicator which could tell me whether text in txBody tag is bulleted or not, can you please me in identifying which indicator should I use to understand whether the text is bulleted or plain ?

-Thank you

like image 944
HaveFun MediaSolutions Avatar asked Mar 23 '12 07:03

HaveFun MediaSolutions


1 Answers

Inside the txBody tag, you can look for the tags "a:buFont" and "buChar" which helps you identify that the text is bulleted. eg.

<a:buFont typeface="Arial" pitchFamily="34" charset="0"/>
<a:buChar char="•"/>

Update:

Hi, +1 For posting this question, learnt a lot from it.

After googling I found this link which addresses similar issue, the resoponse from Adamm clears this,

"Ok, so i think ive got this figured out. Basically if no formatting is specified in the layout or the slide, it goes to the master, and if its a 'title' or 'ctrTitle' shape it uses the formatting in and it defaults to lvl1. Same goes for text that is not in a title shape, for these it defaults to the formatting in and if no lvl is specified it defaults to lvl1. And another piece of advice, although not pertinent to my original question, there is another txStyle in the slideMaster, which is used for text in a shape that is not in a txBody."

Now the slide in your pptx is using "Office Theme" and the text you are interested in is in the format shape within the slide design. The bulletted text is inheriting from the slideMaster1.xml in SlideMasters.

As mentioned in the above quote the buletted text is getting inherited from "a:lvl1pPr" of "p:bodyStyle" in the slideMaster1.xml, also you can see the level 2 bullet is defaulted to "-" for the office Theme slide master there.

I tried to confirm this by changing the char = "•" to ">" to see the bulleting changed to ">" in the below line

<p:bodyStyle>
      <a:lvl1pPr marL="342900" indent="-342900" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
        <a:spcBef>
          <a:spcPct val="20000"/>
        </a:spcBef>
        <a:buFont typeface="Arial" pitchFamily="34" charset="0"/>
        <a:buChar char="•"/>
        ....

Now if you want to change it programatically you can do this from slide master 1. But the only problem here is When we change the bulletted style here(like above), it is changing for all the slides and also for the future slides you will be creating with the same theme within your ppt.

Hope this helps.

Regards.

like image 62
Flowerking Avatar answered Oct 19 '22 14:10

Flowerking