Desperate! Help Please!!!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Call my files: file1.pdf, file2.pdf and file3.pdf
I need for these files to be renamed as file1mmddyy.pdf, file2mmddyy.pdf and
file3mmddyy.pdf

This is the code I am trying to use. Can you tell me why this won't work?
If it does work, can you fill it in appropriately with the file names that I
have listed above? What does the writer mean "predetermined.pdf"?


Public Function PrintPDF()
Dim OutputFileName As String
Dim SaveFileName As String
Dim ReportName As String
OutputFileName = "G:\Daily Reports\PreDetermined.pdf"
ReportName = "FirstReport"
DoCmd.OpenReport ReportName
SaveFileName = "G:\Daily Reports\" & ReportName &
Format(Date,"mmddyyyy") & ".pdf"
Name OutputFileName As SaveFileName
ReportName = "SecondReport"
DoCmd.OpenReport ReportName
SaveFileName = "G:\Daily Reports\" & ReportName &
Format(Date,"mmddyyyy") & ".pdf"
Name OutputFileName As SaveFileName
ReportName = "ThirdReport"
DoCmd.OpenReport ReportName
SaveFileName = "G:\Daily Reports\" & ReportName &
Format(Date,"mmddyyyy") & ".pdf"
Name OutputFileName As SaveFileName
End Function
 
You can use the filecopy to copy the file and rename them

Public Function PrintPDF()
FileCopy "G:\Daily Reports\PreDetermined.pdf" , "G:\Daily
Reports\FirstReport" & Format(Date,"mmddyyyy") & ".pdf"

' copy the other two files here

End Function
 
Back
Top