List Elements not working with multiple LoadText in same Line

Hi,

I have more than one DocumentVariable in one line, like so:

DocVar1 DocVar2

The Content of the Variables look like this:

  • one
  • two

when i replace that with document.Content.Find(…).ToList().Foreach(cur => cur.LoadText(HTMLTEXT…)

then the resulting docx/pdf looks like this

→ the second (or more) variable doesn’t get replaced correctly.

the same would happen to the first variable if i just put a whitespace at the beginning of the line.

can i keep the formatting for the following variables somehow?

Hi,

Unfortunately, without reproducing your issue and investigating the documents, it’s difficult to suggest anything.

Nevertheless, can you try the following:

document.Content.Find(…).Reverse().ToList().Foreach(cur => cur.LoadText(HTMLTEXT…)

If the problem remains, please send us a small Visual Studio project that reproduces your issue so we can investigate it.

Regards,
Mario

i tried to create a sample project and it seems the problem is not gembox but some of our code.
gembox is replacing it correctly if i remove some other operations before it.

please close this topic. thanks