Get a correct justified text from excel to word

Here’s a simplified sequence to show you what I need to do.

I have a word document with a key word to remplace with a text from excel :
image

As you can see the key word is justified so when you replace this word by text the text will be justified.

Here’s the text in excel, 2 paragraph of lorem ipsum :

Here’s the Uipath sequence :
image

And finally the result :

As you can see the text that replaces the keyword is well justified but the line break for the paragraph is not correct and creates this unsightly line at the end because it doesn’t have enough words. By the way, if I do the enter key myself at the end of the unsightly line I get this:

My solution would have been to have a second keyword in the text (example {{jump_line}} that I replace by VbCrLf later on…


image

Here is the result:

As you can see, nothing changes.

Do you have a clue how I could “unjustify” the last line in a simple way?

Regards,

Hi @Maxime_Bonis

I recommend to activate the view of the “invisible signs” in Word for a better analysis:
image

After this your text looks a bit like this.
image

I assume that you have some special paragraph properties activated (e.g. Spacing before/after oder line spacing).

Paragraph properties are those by default. What I should have is this char :
image
not this one :
image

But what is the Vb constant corresponding to this char ? After testing it isn’t VbLf, VbCr, VbCrLf.

You could e.g. replace them by using ASCII codes:

image = Chr(13)
image = Chr(11)

That’s was a good idea but it didn’t work :


image

Guess it is better to use the Word activities and the image activity of this package within the Word Scope.

This is working fine for me. The “standard” activity image you are using is also not working for me.

Just try it with the UiPath.Word.Activities.

1 Like

It worked !

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.