cancel
Showing results for 
Search instead for 
Did you mean: 

How to get word document data to collection

vikaskalwala2
Level 2
Hi, Can someone please tell me how to get ms word data to collection.
2 REPLIES 2

Mustafa_UlasYig
Level 6
Hi Kalwalavikas It is pretty straightforward. 1) You start by expanding on the MS Word VBO action ""Copy to Clipboard"", code stage: ""Copy to Clipboard"": If s IsNot Nothing Then s.Copy Selection end = Len(s.text) d = Nothing w = Nothing s = Nothing With the underlined line above, this gives you the number of the last character in your word document. If you do not want to change the official MS Word VBO, you need to find a workaround to find this number. 2) You use this ""Selection end"" value (number) in the MS Word VBO action ""Get Body"" input ""finish"", to get the word text to a text data item. 3) You need to replace linefeeds with spaces in the text: Replace([bodytext]; Chr(10); "" ""), with this calculation stage. 4) Use the Utility - Strings BO action ""Split Text"" with the input: ""Split Char"" defined to "" "" (space) and ""Collection Field Name"" = ""Text"" (or whatever you want to name the collection field). This should give you every word in the word document separated in a collection with one field. I'm sure there are other ways to do this...! Good luck. BR, Mustafa

Shruti_AnilNark
Level 4
Thanks Mustafa, this works perfectly.