Sounds like you'd have to use ActiveX Automation to control Word.
Is your application target more than one machine on which different versions
of Word might reside? If so, you have to contend with API and behavior
differences between different Word versions.
If you have control of the target machine(s) and can dictate that the most
recent version of Word must be used, then there is a primary interop
assembly for Word provided at no charge by Microsoft -- Google on PIA or
"Primary Interop Assembly", plus Word. You might haunt the sites and
discussion lists pertaining to Office development as well.
If you have an older version of Word then you can just have VS generate an
Interop assembly for Word, but if you try to do anything non-trivial you may
well end up dealing with version-specific quirks, from what I've heard. For
sure, your automation code would have to be tested against every version of
Word that you might have to talk to.
Another possible avenue exists. The most recent version of Word can save a
document as XML. This XML format is publicly documented by MSFT. You can
parse and transform it like any other XML document. The downside is, the
XML format is huge and complex; also, you may not be able to get the
producer of the original documents to save in that format reliably (though
you could use Automation to open a native Word document and save as XML as a
first step).
I have not actually had to do any of the above stuff yet (knock on wood) but
from what I've read it's all way more tricky than it ought to be.
--Bob
"Radek" <rd********@pf.pl> wrote in message
news:cv**********@atlantis.news.tpi.pl...
Hi, I have got such problem:
in my directory "C:\folder" I have 3 files in MS WORD (having tables,
images
etc), these are:
"1.doc", "2.doc", "3.doc".
I want to write an application (C# of course) which will
merge the contents of files which I will point ie. 1.doc and 2.doc into
one
file: "12.doc"
I've just tried to find smth in MSDN help, and in google archive of
programing groups but still I don't know how to do it:(
I found that I can use WORD COM or using VBA (Swierszcz and Konrad ideas)
but still it is not working :(
have U got maybe such problem ?
If You resolved it Could U help me ?
Thank You very much
Best regards
Radek
windows messenger: rd********@o2.pl