Article ID: 182629
Article Last Modified on 10/11/2006
Sub ValidateFolder()
' Create a variable to store path.
Dim strPath As String
strPath = "Macintosh HD:test:"
' Create a variable to hold the name of the presentation.
Dim strShowName As String
strShowName = "MyShow"
' Check if the folder exists.
If "" <> Dir(strPath, vbDirectory) Then
' The folder is valid, so save the file.
ActivePresentation.SaveAs strPath & strShowName, ppSaveAsShow
Else
' Place code to handle the case that the folder does not exist.
End If
End Sub
NOTE: The Dir() procedure does not validate your hard disk name. If you add a ":" after the hard disk name, Dir() returns the first folder in the root of your hard disk. If you pass Dir() the name of your hard disk without using the ":", it always returns "". The following code returns the first folder in the root of your hard disk:
strDirReturn = Dir("Macintosh HD:", vbDirectory)
Replace "Macintosh HD" with the actual name of your hard disk.
Additional query words: mac_ppt ppt98 ppt_98 powerpoint 8.00 mac_powerpt powermac powerpt vbe vba macro code sample example snippet Run-Time error -2147483640 80000008 Presentation unknown member already exists and can t be replaced
Keywords: kberrmsg kbmacro kbprogramming kbprb kbdtacode kbcode KB182629