Welcome to OpenXML Developer Sign in | Join | Help

agent question about manipulation of PPTX slide contents!!... Help

Last post 08-17-2008, 1:19 AM by eitanal. 1 replies.
Sort Posts: Previous Next
  •  08-17-2008, 12:51 AM 3571

    agent question about manipulation of PPTX slide contents!!... Help

     

    Hi ,  my project requires dynamically setting contents in a ppt file  and outputting it to the client browser  ---- it is an asp.net project , so the "office-com-library" is unadvisable to adopt in such senario while OpenXml , as a "cross-platform" standard interface , is a proper tool  when handling this.

    Now let me explain the program in details .   Initially ,  a "pptx" file , as an original template , is provided ; some textFrame or image shapes are pre-defined in it , waiting for population of  "real values" ;   when user triggering an asp.net button , backend will process certain data-analyzation and work-out some expected datums ; then thread loads basic template "pptx" file , finding all target "shapes" , populating  each of them  with corresponding resolved value.

    I refered the dll provided by MS "openXml" SDK  , wrote some testing code and got the "PresentationPart" / "SlidePart"  objects without problem.  However , I got obstructed at this point: I don't know how to access these "shapes" objects enclosed in a "SlidePart" object. There seems no explicit Property representing the "textFrame" in a slide body. ..    I search the internet but hard to find any "openXML"  based solution or tutorial concerning about this ..      So, I hope the forum can give me a pefect solution...   Any expert may help me ? Thanks !

     

     

     

  •  08-17-2008, 1:19 AM 3572 in reply to 3571

    Re: agent question about manipulation of PPTX slide contents!!... Help

    Hi, you cant see the Tags, probably because you didnt enter any text value inside the shape the <a:t> tag wasn't created...
    So, my suggestion is, in your template add "XXX-{key-unique value}" inside the shape, and then just replace the text when you scan the presentation.

    Example to Shape with text.

     <p:txBody>

            <a:bodyPr wrap="none" anchor="ctr" />
            <a:lstStyle />
              <a:p>
                  <a:pPr algn="ctr" />
                   <a:r>
                        <a:rPr lang="en-US" />
                <a:t>MyText!!!</a:t>
         </a:r>
      </a:p>
    </p:txBody>
View as RSS news feed in XML