I have code in MS Access to select a PDF file. What I cannot figure out is how to then save the selected PDF file to a predetermined path, in this case "mypath". I also need to rename the selected file to the "MyFileName3" string. How can I go about this?
Sub Browse()
Dim fDialog As Office.FileDialog
Dim varFile As Variant
Dim SourceFileName As String
Dim mypath As String
Dim MyFileName3 As String
mypath = "\\Improvement Processes\ClaimsHolding\Local\"
MyFileName3 = & "-03-DealSheet.pdf"
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = False
.Title = "Please select your PDF file"
.Filters.Clear
.Filters.Add "PDF File", "*.pdf"
If .Show = True Then
For Each varFile In .SelectedItems
SourceFileName = varFile
Next
Else
MsgBox "You clicked Cancel."
End If
End With
MsgBox SourceFileName
End Sub