Microsoft Knowledge Base Email Alertz

KBAlertz.com: (285504) - When you use a Microsoft Visual Basic for Applications macro in Microsoft PowerPoint to export a range of slides to a new presentation by using the Export method, the new presentation may contain only the first slide in the slide range.

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 285504 - Last Review: March 22, 2007 - Revision: 3.1

Only the first slide in the slide range is exported when you use the Export method in the VBA macro to export the slide range in a PowerPoint presentation

This article was previously published under Q285504

SYMPTOMS

When you use a Microsoft Visual Basic for Applications macro in Microsoft PowerPoint to export a range of slides to a new presentation by using the Export method, the new presentation may contain only the first slide in the slide range.

CAUSE

This behavior occurs because the Slides.Range.Export method, as defined for the Slides.Range object, exports only the first slide in the range. This is because the Slides.Range.Export method is the same method defined for the Slide object, which exports only the currently selected slide in the format that you want.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:
https://partner.microsoft.com/global/30000104 (https://partner.microsoft.com/global/30000104)
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS (http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms)
To work around this issue, use the following sample code to copy each slide in the range to a new presentation, rather than using the Export method.
Sub exportPres()
   Dim rngSld As SlideRange
   Dim oPres As Presentation
   Dim i As Long
   Dim lStart As Long
   Dim lEnd As Long
   
   '
   ' Set the starting values for the export.
   '
   lStart = 2
   lEnd = 5
   '
   ' Assign the slide range to the entire slide range
   ' collection of the presentation.
   '
   Set rngSld = ActivePresentation.Slides.Range
   '
   ' Add a new presentation to PowerPoint.
   '
   Set oPres = Presentations.Add
   '
   ' From the starting slide index to the last slide
   ' index position, loop copying slides from old to
   ' the new presentation.
   '
   For i = lStart To lEnd
      rngSld(i).Copy
      oPres.Slides.Paste
   Next i
End Sub
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

APPLIES TO
  • Microsoft PowerPoint 2002 Standard Edition
  • Microsoft Office PowerPoint 2003
  • Microsoft Office PowerPoint 2007
Keywords: 
kbprb kbtshoot kbexpertisebeginner kbbug kbpending KB285504
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please