473,396 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Merge word applications

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

Apr 6 '07 #1
6 2402
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]
- mv*@spam.guard.caspershouse.com

"madhu27" <ma***********@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
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

Apr 6 '07 #2
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in message
news:%2*****************@TK2MSFTNGP03.phx.gbl...
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.

Apr 6 '07 #3
Eh, why not? haha. Good catch, it's Word of course.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:OE**************@TK2MSFTNGP04.phx.gbl...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:%2*****************@TK2MSFTNGP03.phx.gbl...
>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.

Apr 6 '07 #4
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/micro...ste-249590.php

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

Dave

Apr 7 '07 #5


"D. Yates" wrote:
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/micro...ste-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
Apr 12 '07 #6
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 [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"madhu27" <ma***********@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
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


Apr 12 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Shyguy | last post by:
I have a MS Word Merge letter that is based on a query. I set up a macro to run the query and then open Word and the merge letter. Word open fine but it can't find the letter. I used RunAPP and...
5
by: Tom Keane | last post by:
Okay, so the deal is, I am doing a mail merge document in order to print invoices. The field I get the amount of money is "invAmount". What I would like to do is be able to manipulate this number...
8
by: Squirrel | last post by:
Hi everyone, I've created a mail merge Word doc. (using Office XP) , the data source is an Access query. Functionality I'm attempting to set up is: User sets a boolean field to true for...
9
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access...
8
by: Darryl Kerkeslager | last post by:
I hope that although this is 25% Access and 75% Word, that someone will know ... The whole problem here arises because 1) Microsoft acknowledges an 'issue' wherein TextInput type FormFields are...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
15
by: sparks | last post by:
They are wanting to use word to print out some cards 4 to a page preformatted stuff from an access database. the problem with this is they don't want to do the same card twice. How can setup a...
4
by: lesperancer | last post by:
I have 3 tables (office97) tblQuote quoteNbr tblDetails ( quote : 1 <-> M: quoteDetails) quoteNbr detailLine product value
1
by: Esther Lane | last post by:
Hello! First off, many many thanks to Albert who wrote the Mail Merge code for MS Access I am using. It has been working beautifully for a few years. However, my client just (without notice!)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.