Menu Close

The Save File Dialog Box

Most of the applications allow users to open or display an empty document. This indicates that such an application expects the user to create a document. Once a document has been created, a user would usually want to store its contents on a medium (hard drive, floppy disk, etc). Microsoft Windows provides a common dialog box for this purpose: The Save As dialog box.

To work with the Save As dialog box:

1. Create a instance of the save as dialog box

Dim SaveFileDialog1 As SaveFileDialog

 SaveFileDialog1 = New SaveFileDialog

 2. Specify the save file extension

 

SaveFileDialog1.Filter = “PDF (.pdf)|*.pdf| Word Document (*.docx)|*.docx| Word 1997-2003 Document (.doc)|*.doc | All files (*.*) |*.*”

 

 3. Open the save file dialog box and get the save file name

If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then

 filename = SaveFileDialog1.FileName

End If

 

 

One comment on “The Save File Dialog Box

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

18,519 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>