public void ReplaceText(string find, string replace) { find = find.Replace("<", "<"); find = find.Replace(">", ">"); string xml = OuterXml.Replace(find, replace); if (xml != "") { LoadXml(xml); } }
private void SaveFile() { StreamWriter writer = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\" + FILE_NAME); string xml = OuterXml.Replace(@"\n", @" "); if (!xml.Contains(@"<?mso-application progid=""Word.Document""?>")) { xml = @"<?mso-application progid=""Word.Document""?>" + xml; } if (!xml.Contains(@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>")) { xml = @"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>" + xml; } writer.Write(xml); writer.Close(); }