none
OpenXML PPT document issue RRS feed

  • Question

  • Hi,

    I'm developing a C# application which will use OpenXML to walk through a PowerPoint document and replace cretain tags with data from a DB, like mail merge used to do long ago...

    I have no problem opening the document and walking through it looking for the tags in the textboxes using the OpenXML framework.  What I am finding is that PPT seems to split some random text blocks into multiple XML entries.  e.g. If I have a text object that contains the string @@endDate and I want to replace that tag with a value.  What I'm seeing is the following:

    - <a:p>
    - <a:r>
    <a:rPr lang="en-US" dirty="0" smtClean="0" />
    <a:t>@@</a:t>
    </a:r>
    - <a:r>
    <a:rPr lang="en-US" dirty="0" err="1" smtClean="0" />
    <a:t>endDate</a:t>
    </a:r>
    <a:endParaRPr lang="en-US" dirty="0" />

    </a:p>

    Its broken into two pieces for some reason.  This seems to happen randomly, some tags are correctly found as the following:

    - <p:txBody>
    - <a:bodyPr wrap="none" rtlCol="0">
    <a:spAutoFit />
    </a:bodyPr>
    <a:lstStyle />
    - <a:p>
    - <a:r>
    <a:rPr lang="en-US" dirty="0" smtClean="0" />
    <a:t>@@startDate</a:t>
    </a:r>
    <a:endParaRPr lang="en-US" dirty="0" />
    </a:p>

    </p:txBody>

    Can someone please tell me how to get around this random splitting of text in the XML?

    Thank you,

    Perry


    pj

    Thursday, November 21, 2013 7:27 PM

Answers

  • I have noticed that the difference between element of a:rPr is that there is an attribute of err.

    I found this element is showed when there is some spelling error in the text. So you can check whether it is.

    I found the specifiction from link below:

    a:rPr

    Sunday, November 24, 2013 5:42 PM

All replies

  • I have noticed that the difference between element of a:rPr is that there is an attribute of err.

    I found this element is showed when there is some spelling error in the text. So you can check whether it is.

    I found the specifiction from link below:

    a:rPr

    Sunday, November 24, 2013 5:42 PM
  • Thank you, that seems to make sense.  Let me go ahead and delete the old tags and just look through the document.

    Assuming this is correct, I need to devise another way of flagging my tags, or making sure they don't violate spelling in PPT.

    Thanks again!


    pj

    Monday, December 2, 2013 2:15 PM
  • Did you find a way to solve this problem? I am also running into this
    Tuesday, January 29, 2019 4:32 AM