Range rng = doc1.Content;
rng.Find.ClearFormatting();
rng.Find.Replacement.ClearFormatting();
rng.Find.set_Style(doc1.Styles["Body Text"]);
rng.Find.Forward = true;
rng.Find.Wrap = WdFindWrap.wdFindContinue;
if (rng.Find.Execute())
{
rng.set_Style(doc1.Styles["Heading 1"]);
}
If I have styles in multiple places in document.It is not working.Only first occurrence will work other same styles will not change.
Can anybody tell me?

Manav PandyaRank #166 · 14.3K reputationPosted Jul 4, 2018, 4:43 AM EDT
chetan AllipurRank #2,527 · 554 reputationPosted Jul 4, 2018, 7:56 PM EDT