Microsoft KB Archive/279238

= PPT2000: Slide.Export Method Causes Error When Exporting as Graphics =

Article ID: 279238

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft PowerPoint 2000 Standard Edition

-



This article was previously published under Q279238



SYMPTOMS
When you use the Export method of the Slide object, you may receive the following error message:

Run time error '-2147467259 (80004005)'

Slide (unknown member): MSO9.dll error



CAUSE
This error message occurs when the slide contains a damaged or corrupted object.



WORKAROUND
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements.

NOTE: The following macro examples work only in PowerPoint. Visual Basic for Applications macros are not supported by the Microsoft PowerPoint Viewer. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

Sample Code for Picture Export
To work around this problem, use the Export method of the Presentation object. The following sample code allows you to control the file name of each graphic.

NOTE: The following sample code requires that you install the Microsoft Windows Scripting Host software before you attempt to run this code. For additional information about the Windows Scripting Host and where to get it, click the article number below to view the article in the Microsoft Knowledge Base:

259103 HOWTO: Use the Windows Scripting Host to Automate an Application

 Create a blank presentation in PowerPoint. On the Tools menu, point to Macro, and then click Visual Basic Editor. On the Tools menu, click References. In the list of references, click to select the Microsoft Scripting Runtime check box. Click OK. On the Insert menu, click Module.  Type the following code in the module: Sub ExportImage ' ' Declare as a string constant which drive path ' you want to export the graphics to. ' By doing it this way, it is simple to alter the ' the location that you will save to. '  Const strDrivePath As String = &quot;C:\your_folder&quot; Dim fsoFile As Scripting.FileSystemObject Dim oSlidesCount As Long Dim i As Long Dim strPadZero As String ' ' Set fsoFile to Scripting's FileSystemObject. '  Set fsoFile = CreateObject(&quot;Scripting.FileSystemObject&quot;) ' ' Get the number of slides in the presentation. '  oSlidesCount = ActivePresentation.Slides.Count ' ' Using Presentation object's Export method, export the ' slides to the folder location of your choice. '  ActivePresentation.Export strDrivePath, &quot;JPG&quot; ' ' After the slides have been exported as graphics, use the ' FileSystemObject to rename the images to a name of your own ' choosing. '  For i = 1 To oSlidesCount ' ' Put leading zeros in front of the current index value if ' i is less than 1,000. This ensures that the images will be ' sorted in proper numerical order when sorted by name. '     If i < 1000 Then strPadZero = Format(i, &quot;000&quot;) Else strPadZero = i     End If ' ' Using the MoveFile method, rename the slide JPEGs to a name of ' your own choosing. In this example, they are being named: '   myslide_00#.jpg '     fsoFile.MoveFile strDrivePath & &quot;\SLIDE&quot; & i & &quot;.JPG&quot;, _ strDrivePath & &quot;\myslide_&quot; & strPadZero & &quot;.jpg&quot; Next i

End Sub </li> Close the Visual Basic Editor, and then save the presentation.</li> Open the presentation that you cannot export to a graphic format when you use the Export method of the Slide object.</li> On the Tools menu, point to Macro, and then click Macros.</li> In the Macro in list, click All open presentations.</li> Click ExportImage in the macro list, and then click Run.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was corrected in Microsoft Office XP.

Additional query words: vba Run time error -2147467259 80004005 MSO9 dll

Keywords: kbbug kbdtacode kberrmsg kbfix KB279238

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.