Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

change file location

I realise that just by changing the pathname it does not mean that the file is moved to that location....I want to move the file to the location and change the pathname so that it points to the new location....Then when I click attach, the user will select a file from a open dialog and the file will be automatically stored in a new location..eg F:\New\.......So when "open" is clicked, the file will open from that location...

Can ya help me?

this is the attachment part of my code

Private Sub cmdAttachment_Click()
Dim mystring As String
Dim strFilePath As String
Dim sFileName As String
Dim strCommonPath As String

On Error GoTo DialogError

With CommonDialog1
.CancelError = True
.Filter = "Text Files (*.txt)/*.txt/Doc Files (*.doc)/*.doc/All Files(*.*)/*.*"
.FilterIndex = 1
.DialogTitle = "Select a file to attach"
.ShowOpen

MsgBox "You have selected " & .FileName

strFilePath = Trim$(CommonDialog1.FileName)
strCommonPath = "F:\New\"
mystring = strCommonPath & Dir(strFilePath, vbNormal)
MsgBox mystring

'''' mystring = Trim$(CommonDialog1.FileName)
''''

txtAttach.Text = mystring
m_recRMA!Attachment = mystring
m_recRMA.Update

End With

DialogError:

End Sub
[1548 byte] By [zali] at [2007-11-11 8:10:13]
# 1 Re: change file location
Check out 'Name' command - this allows you to move a file.
gupex at 2007-11-11 17:25:58 >