The below is the code used for reading data from a Document and porting into a Textfile,
But, Before writing in to a text file I want to remove or ignore special characters which are present in the document.Special characters means arrows, bullets, copy write symbols etc..,.When it comes to text file it shows some random characters.So, I want to remove or ignore those kind of characters or symbols before writing in to a text file.
object file;
file = filepathtb.Text;
object Target = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Temp_str.txt";
Microsoft.Office.Interop.Word.Application newApp = new Microsoft.Office.Interop.Word.Application();
object Unknown = Type.Missing;
newApp.Documents.Open(ref file, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown, ref Unknown);
object format = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatText;
// if(newApp.ActiveDocument.Content.Characters = a
newApp.ActiveDocument.SaveAs(ref Target, ref format, ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown, ref Unknown,
ref Unknown, ref Unknown);