Edit word file using C # and replace

0

I'm developing a C # application that needs to manipulate files in word, I can write and read normally but I'm having difficulty formatting the text, I need to insert an array with some information but word concatenates all the text, as I break the line in word?

            PTSOCIETARIA.Clear();
            PTSOCIETARIA.Append(". receita estadual     " + SOCIEDADE[0].receitaestadual);
            PTSOCIETARIA.Append("\n");
            PTSOCIETARIA.Append("\n");
            oRng = odoc.Range(ref missing, ref missing);
            FindTextnome = "@ptsocietaria7";
            ReplaceWithNome = PTSOCIETARIA.ToString();
            oRng.Find.Execute(ref FindTextnome, ref missing, ref MatchWholeWordnome, ref missing, ref missing, ref missing, ref Forward, ref missing, ref missing, ref ReplaceWithNome, ref missing, ref missing, ref missing, ref missing, ref missing);
            oApp.Visible = true;
    
asked by anonymous 28.02.2017 / 16:35

1 answer

0

I was able to solve my problem by inserting ^ p after the text.

    
28.02.2017 / 16:56