[OfficeUtils] Placeholder not replaced on Word\Word_Export_SetTable action

[OfficeUtils] Placeholder not replaced on Word\Word_Export_SetTable action

  
Forge Component
(17)
Published on 26 Apr by Elena Novozhilova
17 votes
Published on 26 Apr by Elena Novozhilova

Hello,

I'm trying to replace a stakeholder in a word document. I don't know why but sometimes it works sometimes it wont ... It could be because of the table's format?

See the image attached to see the result i'm getting.


Cheers

Solution

Gustavo Gaspar wrote:

Hello,

I'm trying to replace a stakeholder in a word document. I don't know why but sometimes it works sometimes it wont ... It could be because of the table's format?

See the image attached to see the result i'm getting.


Cheers

Hi Gustavo,


The problem you are facing it's most likely related with the way placeholders were created in the internal docx representation.


The word document representation is made up of paragraphs and runs under them. Text in the document is stored under the run on the underlying  xml representation.
 
When writing the template, if you do operations to the text like deleting parts or stopping typing and then  resume, the text will be spitted in several runs. Since OfficeUtills will be searching for a run that contains all the text, it will not be able to find the text to be replaced. 
 
So I recommend you to delete the placeholders on your template an rewrite them again with no stops, or write them in notepad and copy them to the word template.

Since we have been getting this feedback quite often, we have plans to include a mechanism to overcome this in the upcoming OfficeUtils release.

Best regards,

Elena

Solution

Hello Elena,


Thank you very much for you're quick response ! Problem solved ! i rewrote the stakeholders all over again and it worked fine.


Best regards,

Gustavo