- #HOWT TO KEEP SOURCE FORMATTING IN WORD 2010 CODE#
- #HOWT TO KEEP SOURCE FORMATTING IN WORD 2010 WINDOWS#
The slow-down isn't linear, and gets even worse beyond 20 slides. Thus, copying the first five slides might take <1 second, but the total 20 slides takes around 100 seconds in total, with all the latter slides taking longer and longer to run just this single line.
#HOWT TO KEEP SOURCE FORMATTING IN WORD 2010 CODE#
This single line of code takes about 0.01 seconds for copying the first slide over, but by the time it comes to the final slide in the loop, the single line of code takes over 20 seconds to run each time. I am copying a source slide-pack of 19 slides, each of which has a different SlideMaster Design Theme (that's how it comes to me). This line runs incredibly slowly once the destination SlidePack has a large number of "Designs" in the SlideMaster. In this loop, the following line (alone) is problematic: I've actually got this working, however to copy the formats I loop over each slide in the "source" slidepack and do the copy/paste code above. This is the method used prior to PowerPoint 2010. That is, I manually copy all the formats across to keep slide-formatting. Method 1: I use a basic "copy" and "paste" methods, suggested by various others, namely: sourceSlide.Copy()ĭestinationSlide = (slideIndex+i-1)ĭestinationSlide.Design = sourceSlide.DesignĭestinationSlide.ColorScheme = sourceSlide.ColorSchemeĭestinationSlide.FollowMasterBackground = sourceSlide.FollowMasterBackground I wonder if anyone has thoughts on solving either (or both?) of these problems: I have tried two attemps to do this copy and paste step, both leading to a different problem.
My current code works well and opens PowerPoint visibly and does a range of functions on it - except for a component where I "copy and paste" slides from one document to another, "keeping source formatting". The underlying code is similar to what I'd use in a VBA macro or other Microsoft automation component, and is based on the PowerPoint 2010 Object API.) Underneath the hood it uses the Jacob library (Java COM Bridge), I believe.
#HOWT TO KEEP SOURCE FORMATTING IN WORD 2010 WINDOWS#
(Scriptom allows you to use ActiveX or COM Windows components from Groovy. I am currently automating some PowerPoint 2010 functions in Groovy using Scriptom - though this problem may be generic to any PowerPoint automation approach (ie more of a "VBA macro" issue than the particular environment I'm using?).