LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I combine two word files

Is there a example, or does anybody know how to open two different word documents and save them as one word document. I would like it to save the two different files as separate pages. I have the report generation toolkit

Any Help?

Thanks
Bryan
0 Kudos
Message 1 of 8
(7,022 Views)
Ya, I also want to know the same... will be a very good help for me with as many replies as possible.
Regards,
Sreedhar T
0 Kudos
Message 2 of 8
(7,015 Views)
Attached is an ActiveX-based solution (LV 7.0) that does the following:
- Opens document 1
- Jumps to the end of the document (CTL-End)
- Inserts a section break
- Inserts document 2 from file
- Saves combined document

I have no idea where this falls on the scale of elegance when compared to other solutions, but it seems to work with my test cases, and it was fun. The key to doing anything Office-related with ActiveX is to first do the task manually while recording your actions as a macro. Then, you can code a LabVIEW version by examining the resulting macro code. Others might suggest executing a macro in Word instead, or using third-party command-line tools.

Regards,
John
Message 3 of 8
(6,993 Views)
Since you have the Report Generation Toolkit, you probably would find it easier to use the high-level vis to perform this operation. Just use the Word Insert Object.vi to insert one Word document into another. Add the New Report Page.vi to separate the pages. See the attached image.
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 4 of 8
(6,978 Views)
so the active x example works great ... exactly what i've been searching for today .. except when the 2nd document is inserted, it is in a different font and size than the first document, and I have no clue why.  Any suggestions?  i've tried programmatically changing the font, but I can't seem to get it done.  I can get the previous font and size that I want programmatically.
0 Kudos
Message 5 of 8
(6,493 Views)

Hi,

 

I did the following:

My main document is my report

I opened the second file, marked all of it and copied to clipboard

Then back in my main document I pasted it

This works great because pasting in Word takes care of all the fonts and styles

 

(I tried object insertion, and it didn't work as well)

 

Enclosed is a 2010 version, plus an image

 

Nitzan

Download All
0 Kudos
Message 6 of 8
(5,780 Views)

I slightly modified the ActiveX code to take in an array word files instead of a list of 2 word files:

inputs: 

1. array of paths for the word files to be concatenated.

2. single path for the combined word file

 

The other method mentioned here, using the report generation insert object VI, would only show a partial view of the inserted word document.

The activeX method is much better.

 

Hope this helps others looking for this function.

Message 7 of 8
(3,608 Views)

Thanks for doing this. I have just found it and it does exactly what I need.

Message 8 of 8
(2,621 Views)