MY SOLUTION:
I've added a label on top of the RTB to get out the pathname. Once loaded in the label I could re-use it for the saving as thus:
private void btnSelectFile_Click(object sender, EventArgs e)
{
OpenFileDialog openFile1 = new OpenFileDialog();
openFile1.Filter = "Xml Files|*.xml";
openFile1.InitialDirectory = @"C:\";
if (openFile1.ShowDialog() == DialogResult.OK)
{
var FileChosenName = Path.GetFileNameWithoutExtension(openFile1.FileName);
label1.Text = FileChosenName;
richTextBox1.LoadFile(openFile1.FileName, RichTextBoxStreamType.PlainText);
}
}
private void btnSavechanges_Click(object sender, EventArgs e)
{
string strsave = richTextBox1.ToString();
string ReadNameOfFile = label1.Text;
using (SaveFileDialog sfdSave = new SaveFileDialog())
try
{
sfdSave.Filter = "XML (*.xml*)|*.xml*";
sfdSave.FileName = label1.Text + " -NEG";
if (sfdSave.ShowDialog() == DialogResult.OK && sfdSave.FileName.Length > 0)
{
UTF8Encoding utf8 = new UTF8Encoding();
StreamWriter sw = new System.IO.StreamWriter(sfdSave.FileName, false, utf8);
sw.Write(strsave);
sw.Close();
}
}
catch (Exception errorMsg)
{
MessageBox.Show(errorMsg.Message);
}
Application.Exit();
}