Using 'Replace Text in Document' Activity in Word force template to add additonal spacing

Hi All,

Currently i’m developing Bot with activity Replace Text in Document but i found the issue/bug for this activity.

Details : When bot using Word Activity Scope and have replace activity inside, bot will automatically add additional spacing like screenshoot below.

Word Replace.zip (208.0 KB)

Anyone can help to solve my issue?

Thankyou

Hi @aliaga

Could you be more specific…

Hi @mkankatala,

Thankyou for your reply,

As you can see in the screenshoot,

Template : Position word Sample Header Here is in 1st grid
Output : Position word Sample Header Here is in 6th grid

This Output file happen when bot using activity Replace Text in Document

Thankyou

@aliaga

Please try using trim in the input text …may be there is a new line character in the sentence

Str.Trim

Cheers

Okay @aliaga

Try printing the Input value in the output panel. Check the Input value has any spaces, remove the spaces and try again.

Hope it helps!!

HI @Anil_G ,

Already trim the input before go into replace activity but still has no impact.

Thankyou

Hi @mkankatala ,

Already check the input and add trim for input before go into replace activity but still has no impact.

Thankyou

If your file doesn’t have confidential information, could you share your word file. @aliaga

Hi @mkankatala ,

You can download word template from here

Thankyou

I found many word files in your attached zip file.

Could you send which file we have to use @aliaga

It seems that when using ‘Replace Text in Document’ in ‘Word Application Scope’, it will ‘expand’ the header and footer, then search and replace specific text. Other activities such as ‘Append Text’, ‘Read Text’ do not need to ‘expand’ the header and footer so that they don’t force display the header and footer.
I tested version 1.10.1, 1.16.2, 1.18.1 and they have all same behavior.

For ‘Replace Text in Document’, the workaround maybe using ‘Repalce Text in Document’ under System>File>WordDocument.

1 Like

Hi @mkankatala ,

Sorry for late reply, you can use filename Sample Header Here.docx for template using replace activity.

Thankyou