I'm trying to create a button that is able to browse over the files in the entire computer so you are able to save a text file with the score you got (in the game I have made).

I was giving the following code to put into a button,

VB Code:
  1. With CommonDialog1  'open a with statement as there is a lot of code
  2.      .DialogTitle = "Save"  'sets the dialog title
  3.      .InitDir = "C:\"  'sets the initial directory
  4.      .Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"  'sets the file
  5.      'types
  6.  
  7.      .ShowSave  'show the dialog
  8. End With

But I cannot get it to work. When I click on the save button it says for the line,

DialogTitle = "Save" 'sets the dialog title

object required. Since this code is very new to me I dont know what object is missing, could someone help?