M
Mike Weston
Hi
I have written a couple of small programs which update text values on some
slides, for example a time... this value is update evrey second.
My first test application was written in Delphi and my second application
was in C# both seem to exhibit the same problems in the sense that
Powerpoint (2000) leaks some memory and also after a while powerpoint hangs!
Does anyone know if it is possible to do this reliably?
There is some example C# code below.
Regards
Mike
variables
private PowerPoint.ApplicationClass ppApp = new
PowerPoint.ApplicationClass();
private PowerPoint.Presentation ppPres;
initial connect code!
ppApp.Presentations.Open("c:\\pptest\\softboard.ppt",0,0,0);
ppPres = ppApp.Presentations.Item(1);
ppPres.SlideShowSettings.Run();
tidy up at end!
ppApp.Quit();
Round my loop!
PowerPoint.Slide S;
PowerPoint.Shape UpdateShape;
DateTime DT;
for (int i = 1; i <= ppPres.Slides.Count; i++)
{
S = ppPres.Slides.Item(i);
for (int j = 1; j <= S.Shapes.Count; j++)
{
UpdateShape = S.Shapes.Item(j);
if (UpdateShape.Name.IndexOf("SETIME") > -1)
{
DT = DateTime.Now;
UpdateShape.TextFrame.TextRange.Text = DT.ToString("T");
}
I have written a couple of small programs which update text values on some
slides, for example a time... this value is update evrey second.
My first test application was written in Delphi and my second application
was in C# both seem to exhibit the same problems in the sense that
Powerpoint (2000) leaks some memory and also after a while powerpoint hangs!
Does anyone know if it is possible to do this reliably?
There is some example C# code below.
Regards
Mike
variables
private PowerPoint.ApplicationClass ppApp = new
PowerPoint.ApplicationClass();
private PowerPoint.Presentation ppPres;
initial connect code!
ppApp.Presentations.Open("c:\\pptest\\softboard.ppt",0,0,0);
ppPres = ppApp.Presentations.Item(1);
ppPres.SlideShowSettings.Run();
tidy up at end!
ppApp.Quit();
Round my loop!
PowerPoint.Slide S;
PowerPoint.Shape UpdateShape;
DateTime DT;
for (int i = 1; i <= ppPres.Slides.Count; i++)
{
S = ppPres.Slides.Item(i);
for (int j = 1; j <= S.Shapes.Count; j++)
{
UpdateShape = S.Shapes.Item(j);
if (UpdateShape.Name.IndexOf("SETIME") > -1)
{
DT = DateTime.Now;
UpdateShape.TextFrame.TextRange.Text = DT.ToString("T");
}