EraseDrawing() not working in PPT2003?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

During a slide show, user can use the pen tool to draw on the slide, and the
call to SlideShowView::EraseDrawing() method will remove all the drawings on
the slide. This method works with the PPT versions before PPT2003. However,
in PPT2003, it just do nothing. Has anyone experienced the same problem? Is
there any workaround for this?

Thanks.
 
It works fine for me if I right click the slide and select "Erase all ink from
slide". I wonder if they changed something in the object model.
 
Do you know which method is invoked when you select "Erase all ink from
slide"? Thanks.
 
During a slide show, user can use the pen tool to draw on the slide, and the
call to SlideShowView::EraseDrawing() method will remove all the drawings on
the slide. This method works with the PPT versions before PPT2003. However,
in PPT2003, it just do nothing. Has anyone experienced the same problem? Is
there any workaround for this?

New one on me but one way around it would be:

If cstr(val(Application.Version)) > 10 Then ' it's ppt2003 or higher
' Get a reference to current slide in ThisSlide
' I'll assume you know how to do that
For X = ThisSlide.Shapes.Count to 1 Step -1
If ThisSlide.Shapes(X).Type = msoInkComment Then
ThisSlide.Shapes(X).Delete
End if
Next ' X
Else
' it's 2002 or before
' do whatever you're already doing
End if
 
Thanks for your work around. I tried it, but the problem is that those new
drawing objects have not been commited to the slide yet, so that
ThisSlide.Shapes(X) does not return any of them.
 
Thanks for your work around. I tried it, but the problem is that those new
drawing objects have not been commited to the slide yet, so that
ThisSlide.Shapes(X) does not return any of them.

Do you actually have a reference to the slide in a variable ThisSlide?
Could you post the actual modified code you used here?

I'll have another look here too.
 
Thanks for your help, Steve. Here is the code:

if (m_nVersion>=11)
{
_Slide slide = m_SlideShowView.GetSlide();
Shapes shapes = slide.GetShapes();
int count = shapes.GetCount();
for (int i=count; i>0; i--)
{
Shape shape = shapes.Item(COleVariant((long)i));
int type = shape.GetType();
if (type == 23) // msoInkComment
{
shape.Delete();
}
}
}
else
{
m_SlideShowView.EraseDrawing();
}

The 'shapes' collection only contains the objects of the original slide,
none of the new drawing object is inside.
 
Oh (*&@#($.

You're right. [Smacks self in head, calls self some very unpleasant names, impugns
self's intelligence and breeding].

I was letting it delete the ink in slide show mode but after having saved the inkings.
Duh.

It doesn't appear that MS exposes anything we can grab hold of here, does it?
Can you trap the EndSlideShow event and then do the deletions?
 
Back
Top