Best Method to Automatically Integrate Data

B

billb

I'm writing an application where I'd like to allow my users to specify a Word
document (template?) that can be merged with calculation data from my
application. What is the best way to go about this? I've done Word
automation before via COM, but seems to be a big support headache to go this
route. Maybe this is still the best/only way to accomplish this? OOXML
looks great, but I need to support Word 2003 at this point in time.

Any suggestions are greatly appreciated.
 
S

Scott McPhillips [MVP]

billb said:
I'm writing an application where I'd like to allow my users to specify a
Word
document (template?) that can be merged with calculation data from my
application. What is the best way to go about this? I've done Word
automation before via COM, but seems to be a big support headache to go
this
route. Maybe this is still the best/only way to accomplish this? OOXML
looks great, but I need to support Word 2003 at this point in time.

Any suggestions are greatly appreciated.

I think COM is the only way. Why do you see it as a big support headache?
The Word object model is pretty good at being backward compatible, even in
Word 2007.
 
S

Sam Hobbs

You might get a more relevant answer if you clarify your requirements. I do
not know what OOXML is so I am not sure what requirements it could satisfy.

There are many possibilities. You could write a program that uses the Word
objects to update a document. You might say that that won't work for some
reason but note that you have not provided enough information for other
developers to know why not.

You could write a Word macro or an add-in that reads data in whatever format
you prefer, such as CSV or delimited text.

You could use ADO or some other database interface to create an Excel
spreadsheet that is linked, embedded or imported or merged in some other
way.
 
B

billb

Thank you for the response.

The limited experience we had with trying to do a plugin or using automation
there were problems getting the communication between our app and Word going
from time to time. It would work 90%, the other 10% would require phone
calls or email only to find it's some security setting or a conflict with
some other plugin or application. 99% of the time, we could get the folks
working, but we're looking to head support calls off at the pass. I don't
necessarily have any problems with the Office Automation object model.

So you wouldn't think maybe a startup macro that launches when Word starts
and performs the mail merge as an option? It seems to me like that might
cause security problems as well.

Since I can basically start from scratch, I wanted to consider all options.
I appreciate the response.
 
B

billb

Sam,
Thanks for the response. What can I clarify about the requirements that
would be beneficial for you? It really boils down to just a mail merge. I
want to perform it the best way possible that's easy on the end users and the
support staff.

OOXML is the standard format that Office 2007 uses.

I had considered a Word macro. Perhaps something that runs on start up.
Not sure if this creates a security issue.

I don't think ADO will work here. I want to merge with an existing Word
document to allow the users to make it look however they'd like.
 
S

Sam Hobbs

Without clarification of requirements, it is difficult to know what needs
clarification.

Note that in your original question you say "merged", not mail merged. I am
sorry I did not understand that merged means mail merged.

Details such as how the data to be merged is created, who initiates it, who
does the merge, and things like that are likely to be important. I am sorry
that I probably can't help much more but what I am saying is that when
asking questions it helps to be clear about such things.
 
D

Doug Robbins - Word MVP

I would be using code to set the values of variables in a document created
from the template in which there would be corrsponding docvariable fields.
The code would then update the fields in the document so that the
docvariable fields displayed the values that were assigned to them.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
B

billb

Doug,
Thanks for the response. This is something I had not considered. Correct
me if I'm wrong, but this still requires some interaction with Word via COM,
right?
 
D

Doug Robbins - Word MVP

Sorry, I do not know anything about COM, but yes, if you want to produce
something with Word, some form of interaction is required.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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

Top