I have code like this:

```
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
            {
            Microsoft.Office.Interop.Word.Application newApp = new Microsoft.Office.Interop.Word.Application();
            object Source = file;
            object Target = Path.ChangeExtension(file, ".rtf");
            object Unknown = Type.Missing;
            newApp.Documents.Open(ref Source, 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.wdFormatRTF;
            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);
 newApp.Quit(ref Unknown, ref Unknown, ref Unknown);
richTextBox1.LoadFile(Path.ChangeExtension(openFileDialog1.FileName, ".rtf")); }

```

And when I debugged my program, it gave a System.IO.IOException error (The file is being used at the final line of code).