Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My goal is to ensure that the C++ code I insert in my presentation compiles correctly. I therefore thought I'd have each example in a separate file (so that I can compile it), and include the text from those files in the Powerpoint slides... I want this 'inclusion' to be dynamic, so that if I change the code in a file, the slides are automatically updated.

Is it possible? Will I have to use LaTeX instead of Powerpoint? Any other suggestion about how to solve this problem?

Thanks.

share|improve this question
    
I answered a similar question for openoffice here: superuser.com/questions/199624/… maybe this will help. BTW still not sure why he never marked it as the answer. –  jnewman Dec 20 '10 at 6:30

4 Answers 4

up vote 1 down vote accepted
+50

See this question. You don't need code to get the slide to update if you insert it as an object

Powerpoint 2007 linking to external content

share|improve this answer

In PowerPoint you will need to write a macro to read the text and update the slide.

An example of a macro to read a text file can be found here:
Read in text from an ascii file.

You will also need to force the slide to refresh:

' assuming a reference to the current slide in oSl
ActiveWindow.View.GotoSlide(oSl.SlideIndex)

This article could also be useful as an example :
Add a random phrase from a text file to a text box on each slide

share|improve this answer

If you rename a Powerpoint 2010 .pptx file into a .zip file, you can open it via Winzip, 7zip etc.

The slide contents are written in XML files named "...\ppt\slides\slide2.xml" in this packed archive structure.

A snippet from a German .pptx file:

-<a:p>
-<a:r>
<a:rPr lang="de-DE" smtClean="0" err="1" dirty="0"/>
<a:t>A text to change ....</a:t>
</a:r>
-<a:r>
<a:rPr lang="de-DE" smtClean="0" dirty="0"/>
<a:t> </a:t>
</a:r>
-<a:r>
<a:rPr lang="de-DE" smtClean="0" err="1" dirty="0"/>
<a:t>another Text to change</a:t>
</a:r>
-<a:r>
<a:rPr lang="de-DE" smtClean="0" dirty="0"/>
<a:t> </a:t>
</a:r>
-<a:r>
<a:rPr lang="de-DE" smtClean="0" err="1" dirty="0"/>
<a:t>Text ...</a:t>
</a:r>
-<a:r>
<a:rPr lang="de-DE" smtClean="0" dirty="0"/>
<a:t> </a:t>
</a:r>
-<a:r>
<a:rPr lang="de-DE" smtClean="0" err="1" dirty="0"/>
<a:t>Text ...</a:t>
</a:r>
<a:endParaRPr lang="de-DE" smtClean="0" dirty="0"/>
</a:p>

So, it should be possible to prepare a .pptx template file and replace placeholder strings like ${Text1234} using a home-grown tool.

share|improve this answer

I don't know if there is an API which will allow you to code in C++ directly, but there is one for Java: poi.apache.org so you could always wrap in it in a script to execute it.

That said, LaTex sound like a better fit IMHO.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.