Edit word file using c# and replace

Asked

Viewed 339 times

0

I’m developing an application in c# that needs to handle word files, I can write and read normally but I’m having difficulty formatting the text, I need to insert an array with some information but the word concatenates all the text, how 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;

1 answer

0

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.