I work with C# but the two are pretty much the same with .NET, right?
Anyway, why not use a SaveFileDialog?
You could have something like this, it would open up a SaveFileDialog, and then write the contents to the file path that the user chose in the dialog.
Here's an extract from some code that I'm working on now:
csharp
SaveFileDialog sfn = new SaveFileDialog();
sfn.Title = "Save File As...";
sfn.Filter = "Text File (*.txt)|*.txt"; // the |*.txt specifies the format, The Text File (*.txt) is the display on the menu
sfn.InitialDirectory = System.Environment.CurrentDirectory; // set the initial directory to the path of the executable
if (sfn.ShowDialog() == DialogResult.OK)
{
StreamWriter SW;
SW = File.CreateText (@sfn.FileName);
SW.Write (@code.Text);
SW.Close();
currentlyOpen = @sfn.FileName;
}
Hope this helps
EDIT:Here's a stab at VB (don't mock me, I'm clueless in VB)
vb
Dim sfn As New SaveFileDialog()
sfn.Title = "Save File As..."
sfn.Filter = "Text file (*.txt) | *.txt"
sfn.InitialDirectory = System.Environment.CurrentDirectory
if sfn.ShowDialog() == DialogResult.OK ' not sure if there's a keyword instead of == which means "is equal to"
{
StreamWriter SW;' create a stream writer
SW = File.CreateText (sfn.FileName) ' create the file
SW.Write (nameOfStringToWriteToFile) ' write the contents
SW.Close() ' close the stream writer
}