Nested Autotext possible??

I

Ivan Debono

Hi all,

I currently use Word 2003 to create templates from which I create standard
documents with data coming from a database. I first design the page how I
want it to look and then set bookmarks on text that will be replaced by the
recordset values. I select the whole document or sections of the document
(depending on my needs) and place the text in Autotext entries. I then
delete everything a save the template. That's all.

This works fine from simple templates but I now I need something a little
bit more complex.

I have a master-details relationship that I need to print on a 5x3 index
card so the place is very limited. First come a few master fields one under
the other. Then I need to sort of have a 2 column table. The first column
displays the details fields (one under the other), whilst the second column
has a few more master fields.

Setting the bookmarks for the master & details fields is no problem. The
problem is the autotext entries. If I select all the text as my master
autotextentry, it will also include the details autotextentry. But I need to
have multiple details for each master record.

It is possible to have nested autotext entries? Is there an alternative
(maybe easier) way to do this?

Thanks,
Ivan
 
J

Jonathan West

Hi Ican,

Investigate using the AUTOTEXT and AUTOTEXTLIST fields. I think they might
be able to help you
 
T

tommieK

Hi Ivan,

Could you add a field to the database holding the autotext name. Then in
VBA get the autoname (say AuthorText_3), goto the bookmark (e.g. AuthorText)
and insert the field. You may find it best to create a single autotext file
and reference this out.

Hope this helps.

Tom
 
I

Ivan Debono

That's how I'm nearly doing it at the moment.

What I do is have a special query with sensible/readable column names. The
autotext entries are also saved in another table and has a field for the
query. So in my app I do the following:

1. Get the auottext record that matches the autotext entry I want to use in
word
2. Get the query used in autotext record and run it (passing any required
parameters)
3. Loop thhrough the recordset, setting each column in the bookmark back in
word (by matching the column names)

As I said, this works fine for simple documents but not for the complex one
that I need.

Ivan
 
T

tommieK

OK, I work with similar documents. What we do is have two tables, one with
the table name, autotext name and bookmark name. A further table with the
table items, x-pos, y-pos within the table. This may resolve your
performance problems, set a range and populate the x/y pos; only bookmark the
first cell in the table.

This works with large documents, although as I say its best to have one
dedicated autotext file and reference out to this.

Tom
 
I

Ivan Debono

This would solve the problem if the users aren't allowed to modify the
templates. But the reason why I'm using word templates is that the users are
allowed to change the templates however they like.
 
I

Ivan Debono

Basically what I want to achieve is something like a report designer (take
Access as an example), where the user designs his own report. The link to
the database is over the bookmarks though.

Is it possible to achieve something like that with Word?

Ivan
 

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