Emptying the Office Clipboard programmatically

  • Thread starter Thread starter Martin Hinchy
  • Start date Start date
M

Martin Hinchy

Windows XP PowerPoint 2002 (SP2)

Hello All,

I have a VC++ 6.0 kiosk application that uses PowerPoint
2002. During execution the application copies and pastes
slides from one presentation to another. It can run for
several weeks and during this time may copy and paste
hundreds of slides. It uses the SlideRange collection's
Copy method and the Slides collection's Paste method to do
this.

During testing we have found that everytime a copy and
paste is done, PowerPoint gradually increases its memory
usage (from 8MB up to approx. 130MB) until eventually the
Paste method fails with a run time error (16389).

I presume this is occurring because the Office Clipboard
is filling up with all the copying and pasting that's
being done. My question is does anyone know how to
programmatically clear out the Office Clipboard? We have
tried emptying the Windows clipboard but this has no
effect.

Regards
Martin
 
Sonia,

You awake?

Then I'm not here and I'm definitely not posting anything, btw <vbg>.

Seriously, it is 11pm here and I have worked like crazy today. Got a lot
done, also. Night, all.

;-)

--
Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Remove spaces from signature
 
Martin,
The only workaround we can think of is to get our C++ app
to close and re-open PowerPoint periodically.
Yes, that would work well too. Are you running it with PPT window visible?
If you keep the window hidden you will get tremendous performance boost
while doing time consuming processing.


--
Regards
Shyam Pillai

Shyam's Toolbox for PowerPoint
http://www.mvps.org/skp/toolbox
 
I also have a C++ app controlling PPT 2002. It builds presentations by
copying and creating slides. It may do hundreds of them in a run. I
haven't had any problem with memory leaks any some sites have been running
for over 2 years. I do close Powerpoint each time (approx. every 15 mins)
after building all presentations. In some sites the program may build 100+
presentations of 10 - 30 slides before closing.
 
The memory problem may have nothing to do with the copy-paste
operations. From what I recall, just having some (all?) versions of PP
running for an extended period caused memory problems. Folks who use
PP for an extended slideshow report that closing PP at least once a day
is helpful. I imagine you will find more by searching the google.com
archives of the PP NG.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
The application is being used to present train timetables
and or promotional content to passengers.

We have set it up such that one PowerPoint presentation is
visible to passengers. When an updated timetable or new
promo content is received from a server, this is opened
into a hidden presentation, the slides are copied out of
this presentation and then pasted to the end of the slides
collection in the visible presentation. The hidden
presentation is then closed. This ensures that the visible
presentation is not interrupted and slides continue to
transition smoothly.

Originally we did no cutting and pasting. We brought the
hidden presentation to the foreground and then closed the
previously visible presentation. This was no good however
because we couldn't get PowerPoint to smoothly transition
between presentations. The screen always blacked out or
the desktop appeared momentarily as the presentations were
switched.

Thanks for your help.
Regards
Martin
 
Mike,

Thanks for the reply.

The reason we think it's a cut and paste problem is
because if we get the app to open PowerPoint and then just
display one presentation only (no cutting and pasting)
PowerPoint will run quite happily for several days with no
increase in memory. It does eventually lock up or crash as
has been well documented on the MVP's sites.

During our testing we have cut and paste 10 slides from a
hidden presentation into the visible presentation every
minute. When we do this PowerPoint leaks memory for about
a day and then crashes.

When we increased the cut and paste to 10 slides every 10
seconds PowerPoint crashed after about 1.5 hours.

This is part of our load and volume testing where we
deliberately try and stress the app as much as possible.
In reality the app will only perform the cut and paste
operation about 10 times a day. Therefore we feel that
rebooting every 24 hours should be sufficient.

Also the app is being used to present information to train
passengers. Therefore we can't restart PowerPoint too
often as passengers may then miss timetable information.

Regards
Martin
 
Back
Top