I have to fill documents from tables in access.
Actually i have 3 choices:
1. Mailmerge in vb with the tables field
2. using a routine replacing all the parts i need using numbers like 1____
and 2_____ and so on
So i can do a for next replacing the index & "_" using find
(.MatchWildcards and so on)
3. using bookmarks and replacing them
What do you suggest me as best solution?
Mail merge will not require you to perform any coding. From the Tools menu
in Access, select Office Links and then Mailmerge with Word.

Signature
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
>I have to fill documents from tables in access.
>
[quoted text clipped - 10 lines]
>
> What do you suggest me as best solution?
Mainframe Sconvolto - 28 Nov 2007 19:43 GMT
> Mail merge will not require you to perform any coding. From the Tools
> menu in Access, select Office Links and then Mailmerge with Word.
I have ti open file A, or B, or C till G dependings on the type of
Department
so i use code to fill it
Doug Robbins - Word MVP - 28 Nov 2007 21:27 GMT
In that case, I would use { DOCVARIABLE varname } fields in each of the
templates and have your code create a new document from the required
template and create variables in the document with the values from the
fields in the record and then update the { DOCVARIABLE } fields in that
document.

Signature
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
>> Mail merge will not require you to perform any coding. From the Tools
>> menu in Access, select Office Links and then Mailmerge with Word.
>>
> I have ti open file A, or B, or C till G dependings on the type of
> Department
> so i use code to fill it
I have a nice working sample that does a merge of the current record to
word.
The sample I have can be found here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
What is nice/interesting about my sample is that is specially designed to
enable ANY form with ONE LINE of code....
Thus, each time you build a new form, you can word merge enable it with
great ease.
Make sure you read the instructions from above, and you should eventually
get to the following page
http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html
Note that the merge can also use a query, and thus you don't have to merge
just "one" record..
After the merge occurs, you get a plain document WITHOUT any merge fields,
and this allows the end user to save, edit, or even email the document
(since the merge fields are gone after the merge occurs).
Give the above a try.
I also don't use bookmarks, but use the standard merge fields. And, it like
notable that my access code actually creates a csv file, and then I set word
to use that csv file as a data source. I do this for increasing reliability,
and NEVER let word actually connect to the ms-access database (as that can
cause a lot of problems....one of which word tries to launch anohter copy of
access!).

Signature
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
ryguy7272 - 29 Nov 2007 15:07 GMT
This is a GREAT resource for what you want to do:
http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm
Look at 'Access Example 1' and 'Access Example 2', both are about 1/2 way
down the web page.
Regards,
Ryan---

Signature
RyGuy
> I have a nice working sample that does a merge of the current record to
> word.
[quoted text clipped - 27 lines]
> cause a lot of problems....one of which word tries to launch anohter copy of
> access!).
Mainframe Sconvolto - 29 Nov 2007 17:39 GMT