Sree2311
(Sree Nandhini J)
February 5, 2018, 4:20pm
1
Hi ,
I have multiple word file created on different paths.
I need to combine the multiple word documents into single word document.
May I know what is the best approach to achieve this in UiPath?
@aksh1yadav , @ddpadil , @vvaidya , @vikas_reddy_Vicky , @Vikas.Jain : Let me know your views on this.
Regards,
Sree
arivu96
(Arivazhagan A)
February 5, 2018, 4:41pm
2
HI @Sree2311 ,
get all the document file path and store it in string .
using for loop → loop through it
use Read Text read the all content after the using Append Text activity append the the text in to one word file.
Regards,
arivu
1 Like
vvaidya
(Vinay Vaidya)
February 5, 2018, 11:12pm
4
You should be able to retain the format(Colors,Tables etc) when you merge docs.
You can accomplish using Invoke Code if you can code.(google for VB.NET code)
or
Try this
3 Likes
It might be helpful to know that Word has features to insert multiple documents.
Go to Insert > Object Drop Down > Text from File > list all files then click Insert
Key combo to get to the option is
"[k(alt)]njf"
4 Likes
Sree2311
(Sree Nandhini J)
February 8, 2018, 4:05pm
6
Thank you. This method works.
1 Like
MohithK
(Mohith)
September 5, 2019, 12:05pm
7
Hi @arivu96 Can you please share the code for this?
MohithK
(Mohith)
September 6, 2019, 5:53pm
8
Hi @vvaidya , Can you please send the code for merging different word docs into a single one
I’m not able to follow you, and the code would better help me. Thanks for your help in advance.
martinw3
(Martin Ross)
September 6, 2019, 7:34pm
9
@MohithK
The method from Arivu96 and ClaytonM is to use the Insert Text From File ability in Microsoft Word.
If you attach to an open Word application window, and send the hotkey command provided by ClaytonM ( “[k(alt)]njf” ), it will open the menu to merge multiple word documents to the current open document.
Key strokes of Alt + n, j, f will open the Text from file menu
Once the window is open you simply need to select the files you wish to merge with the current file.
You’ll want to launch a word instance using Word Application Scope and use the Send Hotkey or Type Into command.
See if you are able to replicate in UiPath!
Cheers
1 Like
MohithK
(Mohith)
September 10, 2019, 11:18am
10
Thanks for your help @martinw3
Will try it and get back to you if I have any questions.