File SaveAs fucntion
File SaveAs fucntion
(OP)
I was wondering if any one could help me?
I wrote a program that out puts CAD files. But want I need is a way for the user to select what directory they want the files to be saves in. It would be nice is I could get their choice as a string so I can add it to the rest of the needed file information.
Thanks for your Help
Mike mikepacholski@hotmail.com
I wrote a program that out puts CAD files. But want I need is a way for the user to select what directory they want the files to be saves in. It would be nice is I could get their choice as a string so I can add it to the rest of the needed file information.
Thanks for your Help
Mike mikepacholski@hotmail.com





RE: File SaveAs fucntion
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: File SaveAs fucntion
Thanks
Mike (mikepacholski@hotmail.com)
RE: File SaveAs fucntion
Dim sFileName As String
Dim UsrRes, s1 As String
dlg.Filter = "Text File (*.txt)|*.txt"
dlg.InitDir = "C:\Temp\"
dlg.ShowSave
sFileName = dlg.FileName
sPartName = dlg.FileTitle
If Len(sFileName) = 0 Then
MsgBox "Cancelled!"
ElseIf Dir(sFileName) <> "" Then
'File Already Exists - Prompt User
s1 = sFileName & vbCrLf & "Already Exists." & _
vbCrLf & "Should I overwrite the file?"
UsrRes = MsgBox(s1, vbYesNo + vbDefaultButton2, _
"Overwrite Existing File?")
If UsrRes = vbNo Then
MsgBox "Orignal File Preserved!", _
vbOKOnly, "New File Not Saved!"
Else
Kill sFileName
End If
End If
'Save your file
MsgBox sFileName
Hope this helps!
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: File SaveAs fucntion
Mike