Calling on all MS-Word Guru's

T

TTT

We are building a database solution for a large client and need to build
complex reports with Word.

To paint a picture:

The database solution we are building creates a data file which is used
in the merge process. We launch a template and macro, and a new
document is created based on the data within the data file. This all
works well.

We need to extend this functionality and do some complex stuff with
mail merge (or any other method if necessary).

We need to produce a report (i.e. the Word document), which is a
collection of data from different tables/sources.

The report will have different sections such as Employment History and
Education History (and more). These sections are really individual mail
merges themselves, which read data from different sources.

The sections will have a series of fields on a single page - and each
record within the data file will merge into its own page - we're not
bringing them into a table.

This isn't too complex, but that's not where the problem lies.

If you imagine several sections similar to that described above, each
requiring a different data source, and then all this merged into one
document.

It's almost like we're trying to "Include" smaller merges into a larger
one, just like you would use "Include" in HTML or other programming
languages.

We figure that we might need to perform each section as individual
merge documents, and then some how bring these files into the main
one.

We've even toyed with the idea of creating the sections as MS-Word
Objects embedded into the main document. Which sounds kind of right -
except we couldn't figure out how to trigger the merge within the
embedded object. Triggering the merge manually within the embedded
document tries to create a new document - which screws up our
automation process.

OK - lots to digest - Assistance is greatly appreciated.

Thanks. :rolleyes:
 
J

Jezebel

You haven't said what you're using to create the database application
itself; but if possible do all the work at the database end. Try to get an
app to interact with Word code, particularly if there's mailmerge involved,
is hell on wheels at the best of times. You chase yourself up your own
backside trying to debug the set up, it's a nightmare to maintain, and
you'll never be entirely confident of what's going on. Don't go there.

*Much* simpler is to create a Word template that has bookmarks (or a defined
structure) that marks the various sections you need; then from your app,
create a Word object reference, create a new document from the template, and
work your way through the sections, perhaps along these lines (depending on
whatever you actually need to insert) ...

With WordDoc.Bookmarks("EmploymentHistory").Range

Do until EmploymentRecordset.EOF
.InsertAfter EmploymentRecordset(0) & vbtab & ....

.Movenext
Loop

End with

This is really all mailmerge does anyway, with some bells and whistles for
formatting; but there's nothing you can do with mailmerge that you can do
yourself directly from code, and with the advantage that you're not
restricted to a single data source.
 
T

TTT

We're using FileMaker Pro - which isn't able to communicate with Word
and it's not VB programmable.

We currently spit out a data file from FileMaker, and then launch the
template and the macro.

I believe we may need to continue with this arrangement - would your
suggestions work with what we've got?

Thanks. :rolleyes:
 
J

Jezebel

In that case, yes still possible: do all the work using Word VBA,
essentially the same strategy.
 
F

Francis Dion

Hi,

You might want to consider XpertDoc as an alternative to Mail-Merge.
It supports multiple independant data sources and requires one tenth
of the work it would take to achieve the same results using Word
Automation.

You can download a free evaluation copy from www.xpertdoc.com

Good luck!
 

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