-
Notifications
You must be signed in to change notification settings - Fork 474
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 in Header/Footer broke in v 2.5.0 #457
Comments
Hello, I tried a simle sample with DocX v2.5.0 from NuGet, like this: var doc = DocX.Load( "test.docx" ); in the "test.docx", As expeced, the resulting "result.docx" file shows: Could it be related to your "loan.LoanNum" variable ? Thanks |
Its with a section break - 1st page has a different header/footer than the
rest of the document. It does work fine with one header/footer though.
…On Wed, Aug 23, 2023 at 8:23 AM XceedBoucherS ***@***.***> wrote:
Hello,
I tried a simle sample with DocX v2.5.0 from NuGet, like this:
var doc = DocX.Load( "test.docx" );
doc.ReplaceText( new StringReplaceTextOptions() { SearchValue =
"%LoanNum%", NewValue = "123" } );
doc.SaveAs( "result.docx" );
in the "test.docx",
the header contains:
"In the header %LoanNum% is not important."
and the body contains:
"In the Body %LoanNum% is important."
As expeced, the resulting "result.docx" file shows:
in the header:
"In the header 123 is not important."
and in the body:
"In the Body 123 is important."
Could it be related to your "loan.LoanNum" variable ?
Thanks
—
Reply to this email directly, view it on GitHub
<#457 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMZBZGNSBFTPP6IMCWKKRLXWXY4RANCNFSM6AAAAAA32DQPBI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi, This will be fixed in the next release (v2.6). Thank you |
Its adding the text but not removing the search value in the header/footer if I step over the error. Its fine in the body. Rolling back to 2.4.1 or 2.4.0 works fine.
header shows this if I step to next line in code:
Loan# %LoanNum%123456
at Xceed.Document.NET.Paragraph.InsertText(Int32 index, String value, Boolean trackChanges, Formatting formatting)
at Xceed.Document.NET.Paragraph.ReplaceTextCore(Match singleMatch, StringReplaceTextOptions replaceTextOptions)
at Xceed.Document.NET.Paragraph.ReplaceText(StringReplaceTextOptions replaceTextOptions)
at Xceed.Document.NET.Container.ReplaceTextCore(ReplaceTextOptionsBase replaceTextOptions)
at Xceed.Document.NET.Document.ReplaceText(StringReplaceTextOptions replaceTextOptions)
...
The text was updated successfully, but these errors were encountered: