Article ID: 174109
Article Last Modified on 10/11/2006
Sub Backup()
Dim lngNumber As Long
Dim strString As String
Dim strFile As String
Dim strFileName As String
Dim strPath As String
' Generates random number.
lngNumber = Int(Rnd * 100000)
' Converts number to a string.
strString = Str(lngNumber)
' Removes blank space from first of number.
strFile = Mid(strString, 2, 5)
' Adds first two letters and extension to file name.
strFileName = "Bk" & strFile & ".bak"
' Determines path where PowerPoint is stored.
strPath = Application.Path
' Saves file with random name and .bak extension.
ActivePresentation.SaveAs FileName:=strPath & "\" & strFileName
End Sub
Sub Backup()
Dim strFile As String
Dim strFileName As String
Dim strPath As String
' Prompts for file name.
strFile = InputBox("Please enter a file name." & chr(13) _
& "Spaces may not work correctly.")
' Adds extension to file name.
strFileName = strFile & ".bak"
' Determines path where PowerPoint is stored.
strPath = Application.Path
' Saves file with the name you input and .bak extension.
ActivePresentation.SaveAs FileName:=strPath & "\" & strFileName
End Sub
176476 OFF: Office Assistant Not Answering Visual Basic Questions
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: vba macppt mac_ppt ppt98 powerpt
Keywords: kbcode kbdtacode kbhowto kbprogramming KB174109