Hey OBP, I'm trying to get started with the append routine. The originally exported file is a dat file. I'm unaware that it is even possible to open and write to a dat file with VBA. I tried reading from it and it never would work. So I am taking the files that are selected and creating a "_Temp.txt" that I can I use in the append routine. I have it copying both files like I want but the text file gets copied and named as _Temp.txt only and leaves the rest of the filename off from the ctlList. Please see if you see where that is happening because I am overlooking it. Thanks
For varItem = 0 To ctlList.ListCount - 1 ' Print value of bound column - used for testing purposes.
'MsgBox ctlList.ItemData(varItem)
For x = 1 To Len(ctlList.ItemData(varItem))
If Mid(ctlList.ItemData(varItem), x, 1) = "\" Then posn = x
Next x
filename = Right(ctlList.ItemData(varItem), Len(ctlList.ItemData(varItem)) - posn)
' Print value of bound column - used for testing purposes.
'MsgBox filename
strExt = filename
'MsgBox filename, vbInformation, "Testing"
' Replace the extension with _Temp.txt for a new file name
strFileTemp = Replace(ctlList.ItemData(varItem), strExt, "_Temp.txt")
' Copy .txt files
FileCopy ctlList.ItemData(varItem), sDest & strFileTemp
' Reset file extension .dat
filename = Right(ctlList.ItemData(varItem), Len(ctlList.ItemData(varItem)) - posn)
FileCopy ctlList.ItemData(varItem), sDest & filename