Merge word applications

  • Thread starter Thread starter madhu27
  • Start date Start date
M

madhu27

Hi..

I have two word applications in byte arrays.
I need to mege them and combine into one document and prompt the
user to save the merged document.

madhu
 
madhu,

In order to do this, you will have to save the two files to disk. Then,
you need to use the Excel automation model to open each document in an
instance of Excel. Then, you have to copy the contents of one document to
the other (or perform whatever operations you are looking to perform on the
two documents) and save the one document that is the result. You can then
take the file and read the bytes into a byte array.

Hope this helps.
 
Nicholas Paldino said:
madhu,

In order to do this, you will have to save the two files to disk. Then, you need to
use the Excel automation model to open each document in an instance of Excel. Then, you
have to copy the contents of one document to the other (or perform whatever operations you
are looking to perform on the two documents) and save the one document that is the result.
You can then take the file and read the bytes into a byte array.

Hope this helps.

Using Excel to merge Word documents?

Willy.
 
D. Yates said:
Just as a side note, I did see this on www.lifehacker.com the other day:
Combine several Word files into one without copy-and-paste
http://lifehacker.com/software/micr...es-into-one-without-copy+and+paste-249590.php

Maybe the macro will give you some insight into how to combine the two
documents programmatically.

Dave

Macro i think will run on the client and requires word atomation.
How do we merge documents when the data comes as bytearrays?

observed that appending to a file also does not work. It works only if the
data is text only.

Niki
 
Hi Nicholas ,

I did the same.But then,
since the word files are mostly identical,only on file is opening.
the other is not being appended.

I did this using microsoft office interop word dll and the merge method.

plz help

madhu



Nicholas Paldino said:
madhu,

In order to do this, you will have to save the two files to disk. Then,
you need to use the Excel automation model to open each document in an
instance of Excel. Then, you have to copy the contents of one document to
the other (or perform whatever operations you are looking to perform on the
two documents) and save the one document that is the result. You can then
take the file and read the bytes into a byte array.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

madhu27 said:
Hi..

I have two word applications in byte arrays.
I need to mege them and combine into one document and prompt the
user to save the merged document.

madhu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top