Alternative to 10+ "replace text in document" activities

Hi everyone, does anyone know a more efficient method to replace text in word doc. Currently, I’m using 10+ “replace text in document” activities to replace the words using my 10+ variables, and I find it possible that there are better alternatives out there, but I don’t know what. Does anyone have any recommendations? Currently, these activities are used in “word application scope” to replace the values in the doc.

Createa list or array that contains the values. Then loop through it with a For Each.

Hi,

We can achieve it using Dictionary as the following.

Probably the following post also helps you.

Regards,

Hi there, thanks for replying to my question :slight_smile: i’ve tried using the dictionary method, but it seems that there is a limitation for ‘ToDictionary’ in terms of the number of columns it can store? I have currently 15 columns to read through

Hi,

Can you share specific input and output? If it’s necessary to store multiple data, we can use Dictionary<string,List<string>> type etc.

Regards,

If you happen to have multiple columns and one row instead, you could try this approach: C# Datatable to Dictionary - Stack Overflow. It’s in C# but not that different translated to VB.