How does this works

Hi,

Let’s assume content of DT is as the following

image

And word document is as the following.

image

In the loop, first , CurrentRow(“Key”).ToString.Trim is %NAME% nad CurrentRow(“Value”).ToString is John Smith.
So all the “%NAME%” will be replaced with “John Smith” as the following.

image

Next iterate, CurrentRow(“Key”).ToString.Trim is %AGE% nad CurrentRow(“Value”).ToString is 33.
So it will be

image

Like the above, all the key string which is defined in Key column of DataTable will be replaced with value string which is defined Value column.

Regards,

2 Likes