Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: Bodini on August 27, 2008, 09:57:47 AM
-
Is it possible to have Mach prompt the user for the file name to save 'openteachfile' as? I know, i know... it can be set to 'temp' or whatever you want, and the user can rename it after the file is created, but I forget to do that quite often. Anyway, thats a crappy workaround and I'd like to nip it in the bud and name it from the start.
-Nick
-
ppp = InputBox("Enter a File Name:")
OpenTeachFile ppp + ".tap"
code " (Code Here) "
CloseTeachFile
Call LoadStandardLayout()
Call LoadTeachFile()
-
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:
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
-
:DThanks much, Jason. I'll try it.
-
Great ;D