211
VB and the development of wizards / Re: openteachfile name
« on: September 05, 2008, 07:36:54 PM »
Hey Nick,
I stubbled across thisÂ
I dont get much time to come to the forum lately...working on the Mach screen development stuff...
This is what I would do:
Thanks,
Jason Blake
I stubbled across thisÂ

This is what I would do:
Code: [Select]
Dim fso, fldr, s
Set fso = CreateObject("Scripting.FileSystemObject")
'Prompt For Teach file new Name And location
ppp = InputBox("Enter a File Name:")
'Default to C:\ if you just want the name you can allow them to make the file type too
filePath="C:\" + ppp + ".tap"
'Verify
MsgBox ("Copy File: "+ "C:\Mach3\Teach.tap" + " TO: "+ filePath + " ? ")
'Close the FIle if loaded in Mach
DOOEMButton (169)
'If you need to make the user aware there is already a file with that name
If fso.FileExists (filePath) = true Then
'Promt User
End If
'Copy it
fso.CopyFile "C:\Mach3\Teach.tap", filePath
'Open the file
loadfile filePath
'Remove System object Clean up
Set fso = Nothing
Thanks,
Jason Blake