Using a template without destroying the template

T

Travis

About 2 months ago I started writing a database application in VBA and
Access. This was my first ever attempt at using Access and my first
ever attempt to program in VBA.

The Access app is coming along nicely, it does most of the basic data
input stuff. The next step is to get it to fulfill its true purpose,
passing data to Excel and Word (and from Excel to Word) in order to
create some fairly complex documents.

My first stumbling block is that while I've picked up a modest amount
of knowledge about Access development, and an even more modest amount
of knowledge about Word development, I still haven't figured out how to
do cross-application development.

I want to do a bunch of stuff in Access which saves some values to a
table, then click a button in my Access app which will take a copy of a
template Word document, which consists only of a bunch of bookmarks,
and copy sections from another Word document with a bunch of canned
text into the new document at the various bookmark places, then save
the new document as <client name> & <today's date>, then open the
document for editing by hand.

Can anyone give any pointers, or links, so I can manipulate Word
documents in this manner from within an Access app? (NB: I'm writing
for Office XP and Office 2003)

Thanks.

Travis
 
C

Cindy M -WordMVP-

Hi Travis,
I want to do a bunch of stuff in Access which saves some values to a
table, then click a button in my Access app which will take a copy of a
template Word document, which consists only of a bunch of bookmarks,
and copy sections from another Word document with a bunch of canned
text into the new document at the various bookmark places, then save
the new document as <client name> & <today's date>, then open the
document for editing by hand.

Can anyone give any pointers, or links, so I can manipulate Word
documents in this manner from within an Access app? (NB: I'm writing
for Office XP and Office 2003)
Well, there's a file WdAcc97.ZIP in the Mail Merge FAQ on my website that
will show you things like automating Word from another app and dropping
information into a Word bookmark.

For the "canned text", I have to wonder if AutoText might not be better
than an external document? But if I wanted to use an external document,
I'd probably use the equivalent of InsertFile in the Word object model OR
insert an IncludeText field (which is what happens when you insert a file
with a link).

Hope this gets you started, so you can come back with more specific
questions?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
T

Travis

Cindy said:
Well, there's a file WdAcc97.ZIP in the Mail Merge FAQ on my website that
will show you things like automating Word from another app and dropping
information into a Word bookmark.

Sounds wonderful, but I can't find it. Which part of the FAQ page is
it at?
For the "canned text", I have to wonder if AutoText might not be better
than an external document? But if I wanted to use an external document,
I'd probably use the equivalent of InsertFile in the Word object model OR
insert an IncludeText field (which is what happens when you insert a file
with a link).

I'm open to suggestions, at the moment all I've got is an Access app
which saves particular values into a table from check boxes and combo
boxes. I want to press a button and create a word document to the
specifications from the table.

I have no experience with autotext.

The values from the Access table only determine which paragraphs are to
be written to the final Word document.

I am a financial planner. If you are familiar with what an FP does, as
opposed to a stock broker or investment advisor, we're generalists who
go over a client's entire financial situation looking for better ways
to structure portfolios, manage taxes, minimise risks etc. I basically
want to create an application which takes a checklist approach.

After going through my checklist I'll have made recommendations on a
great many issues and then will have to write them up in a document.
I've got a library of text recommending and explaining various
strategies which I want written into the various portions of the
financial plan document.

So for instance if I've ticked the box saying that the client wants
estate planning advice, a tab page becomes unhidden onto which I tick
boxes and choose from lists to make various estate planning
recommendations

On the subject of Wills I can either recommend the client get a Will
drawn up, recommend they review their existing Will, or advise that the
current Will is fine. That's a combobox. I can also tick a box to
recommend that the client have a testamentary trust drawn into their
Will, and there are other boxes to tick and lists to navigate and
values to fill in as appropriate. All of these get saved into an
Access table, e.g. the Will field will say "New", "Review", "Fine" or
something, and the testamentary trust field will either be true or
false.

The text passages I want to insert range from a few words through to
many pages.

So I'm really looking for suggestions (and code examples) of how to
create an automated Word document which draws on a text library and
mixes and matches paragraphs in accordance with my recommendations.

The final product can be as much as 100 pages and give dozens of
recommendations with numerous charts and calculations plus narrative.

What do you suggest I do?

Thanks

Travis
 
C

Cindy M -WordMVP-

Hi Travis,
Sounds wonderful, but I can't find it. Which part of the FAQ page is
it at?
Ah, sorry. Special Merges/Multiple items per condition, under point
3.
So I'm really looking for suggestions (and code examples) of how to
create an automated Word document which draws on a text library and
mixes and matches paragraphs in accordance with my recommendations.
I don't know of any code samples that do exactly as you wish. If you
want to do this yourself, you're going to have to spend some time
investigating AutoText and InsertFile because only you, really, can
say which is more suitable to your needs.

FWIW, I did something similar to this, about ten years ago (Word 95,
that was, using WordBasic). The decision was to use AutoText because
it travelled with the template (the client didn't want to deal with
multiple files, which also meant no database). I used code prefixes
to "sort" the entries by category (there were no AutoText style
categories at the time).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

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