473,399 Members | 2,278 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,399 software developers and data experts.

MS Word how to connect :)

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

Nov 16 '05 #1
2 2602
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

Nov 16 '05 #2

Is your application target more than one machine on which different
versions of Word might reside?
No, I have only one version of Word (MS Word 2002) and it's exactly like You
say:)
I need to write this application to automate some prosseses. Becouse I don't
want to open 2 or 3 or more Word documents and then copy to clipboard the
content for everyone and then create one document.
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.
Thank YOU :) I will check it :) I think this is the solution :) I've just
also found smth like this:
http://msdn.microsoft.com/office/und...wordobject.asp
but I havent read it all so far:)
About all my success or defeat I will write :)
The most recent version of Word can save a document as XML. mine doesn't have :(
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


Yes, I agree with You in 100% :(
but once more Thank You - and now I'm goint to learn about what You've
written for me:)

Best regards
Radek
Nov 16 '05 #3

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

Similar topics

2
by: Steve Barnett | last post by:
Hi, I'm attempting to automate word to load a document. I have no problem if Word isn't loaded yet as creating a new Word.ApplicationClass() loads it for me. However, there will be times when Word...
1
by: Steve Barnett | last post by:
Hi, I'm attempting to automate word to load a document. I have no problem if Word isn't loaded yet as creating a new Word.ApplicationClass() loads it for me. However, there will be times when Word...
0
by: maitrepoy | last post by:
I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003. This addin consists in adding 2 new Buttons in the "File" Menu of office. This is...
0
by: maitrepoy | last post by:
Hello I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003. This addin consists in adding 2 new Buttons in the "File" Menu of office....
0
by: maitrepoy | last post by:
hello I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003. This addin consists in adding 2 new Buttons in the "File" Menu of office....
1
by: raghunadhs | last post by:
Hi all! I would like to write some data to m.s word document, and read data from ms word. till now i used "files" in v.b 6.0, using "input","output" "open" "close" lke...
2
by: raghunadhs | last post by:
Hi all! Pls answer my question, this is third time i am asking..... I would like to write some data to m.s word document, and read data from ms word. till now i used "files" in v.b 6.0, using...
0
by: Omer | last post by:
I am trying to create a shared addin using visual studio 2005 with the following code. It is working only in Power Point Appliction and not loading in Excel and Word I used the Visual Studio Wizard...
4
by: paul814 | last post by:
Hello everyone, Right now I have a simple PHP page setup that takes whatever was entered into txtsearch on the previous page, it searches my DB by that word and brings back the whole record based...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.