J
Jay
I am new to coding so I am trying to learn. I have a save dialog box that I
am able to get to work. I can save a file and all is good. My problem is
when I hit cancel I am getting an error and I am not really sure why. Below
is what I have code for my save dialog and if I debug it errors out at
"textstreamwriter.WriteLine(rtbFontBox.Text)" but if I take that line out
then my save does not save the wanted text. Thanks for you help! : )
Dim textstreamwriter As StreamWriter
Dim responsedialogresults As DialogResult
SaveFileDialog1.InitialDirectory = Application.StartupPath
responsedialogresults = SaveFileDialog1.ShowDialog
textstreamwriter.WriteLine(rtbFontBox.Text)
textstreamwriter.Flush()
textstreamwriter.Close()
If responsedialogresults = DialogResult.Cancel Then
textstreamwriter.Close()
End If
am able to get to work. I can save a file and all is good. My problem is
when I hit cancel I am getting an error and I am not really sure why. Below
is what I have code for my save dialog and if I debug it errors out at
"textstreamwriter.WriteLine(rtbFontBox.Text)" but if I take that line out
then my save does not save the wanted text. Thanks for you help! : )
Dim textstreamwriter As StreamWriter
Dim responsedialogresults As DialogResult
SaveFileDialog1.InitialDirectory = Application.StartupPath
responsedialogresults = SaveFileDialog1.ShowDialog
textstreamwriter.WriteLine(rtbFontBox.Text)
textstreamwriter.Flush()
textstreamwriter.Close()
If responsedialogresults = DialogResult.Cancel Then
textstreamwriter.Close()
End If