I have used the following code too save a notepad file;
The code saves files but only in the 'Application.StartupPath' folder, the save dialogue starts in the correct place a quizzes folder inside the debug folder but files can't be saved here or in folders inside it, even though you can browse them in the dialogue. I want it saving where navigated to in the dialogue. Any help?Code:Dim responsedialogueResult As DialogResult Dim savedataFile As New SaveFileDialog With savedataFile Dim SP, Quiz, f1 As String SP = Application.StartupPath Quiz = "Quizes" f1 = Path.Combine(SP, Quiz) .InitialDirectory = f1 .FileName = saveas .Title = "Select file or directory file" responsedialogueResult = .ShowDialog .DefaultExt = "txt" .Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*" .OverwritePrompt = True .AddExtension = True End With If responsedialogueResult <> Windows.Forms.DialogResult.Cancel Then filesave = My.Computer.FileSystem.OpenTextFileWriter(saveas, False)


Reply With Quote
