In word doc i have multiple image and it has inline text..when i am changing the text using find and replace function the text is disorienting

the text is suppose to be below the image and center of the image but it is positioning in the left of the image after calling the function
I have used below code:-

Regex regex = new Regex(@"([\w\d\s!@#$%^&*()-_+=<>?;:',./`~]+)(\.jpg|\.jpeg|\.png)");
FindReplaceOptions options = new FindReplaceOptions { UseSubstitutions = true };
doc.Range.Replace(regex, @"$1", options);

@Soumen2001 Could you please attach your input, output an expected output documents here for testing? We will check the issue and provide you more information.

issue has been resolved

1 Like