title: VBA PowerPoint Copy/Paste Inconsistencies
body: <p>I have a VBA script written that searches through one PowerPoint (PRS_data) for a title match, and then copies the slide to a new PowerPoint (PRS).  The slides on the source are simply a title and an image.  When some of the slides are copied over, the images are either not carried over or I get a box with a red X.</p>
  
  <p>I am using PowerPoint 2007 SP3, so that red X hotfix isn't the problem.</p>
  
  <p>I also tried adding DoEvents and a Sleep as well, with no success.</p>
  
  <p>If I leave the destination window maximized on the user's screen it seems to work, but if it is minimized, I get sporadic blank slides.  The results are inconsistent.  Also, I can confirm the slides <em>do</em> get copied, because the destination is an empty presentation and it is filled with slides that just have the correct titles on them.  Again inconsistent results though.</p>
  
  <p>Anyone ran into this before??</p>
  
  <p><strong>Here is the code:</strong></p>
  
  <pre><code>For Each Sld In PRS_data.Slides
      If Sld.SlideIndex &gt; 1 Then          
          If (Sld.Shapes.Title.TextFrame.TextRange.Text Like "*" &amp; iDiv &amp; " Division*") Then
              PRS_data.Slides.Range(Sld.SlideIndex).Cut
              PRS.Windows(1).Activate
              PRS.Slides.Paste
              DoEvents
          End If
      End If
  Next
  </code></pre>