Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Common dialog - SaveAs code



On Error Goto ExitmnuInOpen

'open dialog box to get new FileName
CommonDialog1.Flags = cdlOFNHideReadOnly
CommonDialog1.InitDir = App.Path
CommonDialog1.FileName = "*.txt"
CommonDialog1.DefaultExt = "txt"
CommonDialog1.Filter = "Text Files (*.txt)|*.txt"
CommonDialog1.DialogTitle = "Save As"
CommonDialog1.ShowOpen


If CommonDialog1.FileName <> "*.txt" Then
   FileName = CommonDialog1.FileName
    If FileExists(FileName) Then Kill FileName
    Open FileName For Binary As #1
    Put #1, , txtVisible.Text
    Close #1
'    StatusBar1.SimpleText = FileName
   StatusBar1.Panels(1).Text = FileName
   txtHidden.Text = txtVisible.Text
End If

ExitmnuInOpen: