Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReplaceText does not behave as expected in the presence of shapes. #414

Open
janbernloehr opened this issue Sep 5, 2021 · 0 comments
Open

Comments

@janbernloehr
Copy link
Contributor

In the attached document, we would like to replace the text #DocNo with some text using ReplaceText. This usually works but if a Shape is present, then somehow the wrong substring is replaced.

image

This is a regression that has been introduced in v1.3. The issue does not show up in earlier versions.

var path = @"original.docx";
var out_path = @"new.docx";

var document = DocX.Load(path);

document.ReplaceText("#DocNo", "FooBar 1234");

document.SaveAs(out_path);

original.docx

janbernloehr added a commit to janbernloehr/DocX that referenced this issue Dec 27, 2021
…be symmetric with HelperFunctions.GetTextRecursive - fixes xceedsoftware#414
janbernloehr added a commit to janbernloehr/DocX that referenced this issue Dec 28, 2021
…be symmetric with HelperFunctions.GetTextRecursive - fixes xceedsoftware#414
janbernloehr added a commit to janbernloehr/DocX that referenced this issue Jan 5, 2023
…be symmetric with HelperFunctions.GetTextRecursive - fixes xceedsoftware#414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant