I need some help with my code, what I'm trying to do its to copy a text from 1 word and paste it in a new one without "line spaces", with my code it works but.... I lost all the format of the text and I want to keep it, is there any possibility or an alternative to do what I want?
Word.Range rng = Globals.ThisAddIn.Application.ActiveDocument.Content;
rng.Copy();
string TPaste = Clipboard.GetText();
TPaste = TPaste.Replace("\r\n", " ");
TPaste = TPaste.Replace(" ", " ");
object start = 0;
object end = 0;
rng = Protocol.Range(ref start, ref end);
rng.Text = TPaste;