S
Song
some users only have ..\elac folder but no subfolder ..\elac\PhoneBook.
Others even do not have ..\elac folder at all. How to create \elac\PhoneBook
or ..\PhoneBook subfolder if they do not exist? Here is my code:
Private Sub cmdPhoneBook_Click()
Dim strSource As String
Dim strTarget As String
strSource = "S:\Apps\PhoneBook\Phone.pdf"
strTarget = Environ("AppData") & "\elac\PhoneBook\Phone.pdf"
If Len(Dir(strTarget)) > 0 Then
If FileDateTime(strSource) > FileDateTime(strTarget) Then
FileCopy strSource, strTarget
End If
Else
FileCopy strSource, strTarget
End If
Application.FollowHyperlink strTarget
End Sub
Others even do not have ..\elac folder at all. How to create \elac\PhoneBook
or ..\PhoneBook subfolder if they do not exist? Here is my code:
Private Sub cmdPhoneBook_Click()
Dim strSource As String
Dim strTarget As String
strSource = "S:\Apps\PhoneBook\Phone.pdf"
strTarget = Environ("AppData") & "\elac\PhoneBook\Phone.pdf"
If Len(Dir(strTarget)) > 0 Then
If FileDateTime(strSource) > FileDateTime(strTarget) Then
FileCopy strSource, strTarget
End If
Else
FileCopy strSource, strTarget
End If
Application.FollowHyperlink strTarget
End Sub