The code below moves the drawing from Drive C:\ to Drive K:how do I get the path to recongize the new path e.g.
K:\ inplace of C:I'm going crazy, hope someone can help.
Private Sub cmdMoveFiles_Click()
On Error GoTo ErrorX
Dim x As SHFILEOPSTRUCT
Dim StrFile As String
StrFile = Me.DS_X1.Value
'Copies the file in textbox DS_X1
'String function to get rid of the "#" from the hyperlink.
x.pFrom = Mid(StrFile, 2, Len(StrFile) - 2)
'Pastes the file to stated location.
x.pTo = "K:\"
x.fFlags = FOF_NOCONFIRMATION
x.wFunc = FO_COPY
SHFileOperation x
strSourcePath = "C:\Me.DS_X1.Value"
strDestinationPath = "K:\Me.DS_X1.Value"
'Set FS = CreatObject("scripting.FileSystemObject"
fs.CopyFile strSourcePath, strDestinationPath
MsgBox "Copy Complete.", vbOKOnly
Exit Sub
ErrorX:
MsgBox "Error #:" & Err.Number & " " & Err.Description & vbCrLf _
& "Copy Failed."
End Sub
K:\ inplace of C:I'm going crazy, hope someone can help.
Private Sub cmdMoveFiles_Click()
On Error GoTo ErrorX
Dim x As SHFILEOPSTRUCT
Dim StrFile As String
StrFile = Me.DS_X1.Value
'Copies the file in textbox DS_X1
'String function to get rid of the "#" from the hyperlink.
x.pFrom = Mid(StrFile, 2, Len(StrFile) - 2)
'Pastes the file to stated location.
x.pTo = "K:\"
x.fFlags = FOF_NOCONFIRMATION
x.wFunc = FO_COPY
SHFileOperation x
strSourcePath = "C:\Me.DS_X1.Value"
strDestinationPath = "K:\Me.DS_X1.Value"
'Set FS = CreatObject("scripting.FileSystemObject"
fs.CopyFile strSourcePath, strDestinationPath
MsgBox "Copy Complete.", vbOKOnly
Exit Sub
ErrorX:
MsgBox "Error #:" & Err.Number & " " & Err.Description & vbCrLf _
& "Copy Failed."
End Sub