DAO Question Concerning a Word Mail Merge from Access 
Author Message
 DAO Question Concerning a Word Mail Merge from Access

OK, here's what I'm trying to do.  I have made a search form in Access that
allows a user to search by whatever parameters they want.  Once the user had
narrowed down their search they can click a "Merge" button.  This button
runs a function that takes the current form filter and generates a randomly
named Query and uses it to run acCmdWordMailMerge command.  Heres some code
im using :

With dbs
        Set qdf = .CreateQueryDef(queryName, sqlString)
        DoCmd.SelectObject acQuery, queryName, True
        RunCommand  acCmdWordMailMerge
        .QueryDefs.Delete qdf.Name
        .Close
    End With

Notice that I delete the query when the runCommand is done.  I do this so
when the database is being used by 50+ users -- there isnt several hundred
temporary querys laying around.  I use these queries, since as far as I
know, its the only object besides a table that will work with the
acCmdWordMailMerge command.

All of this works perfect.  Word starts with all the right Mail Merge
settings/filter/etc.  The user can add/delete fields and merge and print
their labels/form letters/whatever.

However, heres the problem.  If the user saves his/her form letter in hope
of using it later without having to recreate it, they cant.  Since, next
time the user trys using/opening the templated word document he/she used
before the old data source is gone since it was a temporary query that was
deleted the first time around.

Heres a few questions:

Has anyone tried this type of automated Word MailMerge from Access before?
If so how did you approach it?

Are you familiar with the acCmdWordMailMerge menu command?  Is there anyway
to pass it an SQL string?  Or anything?

Is there a way to change the force update a datasource on a predefined Word
MailMerge Document?

Can someone think of a better way to do all of this?  Or point me somewhere
that may have some info.

Thanks for yout time,
Gary Striano
UCI GSM
Administrative Computing



Sun, 04 Feb 2001 03:00:00 GMT  
 DAO Question Concerning a Word Mail Merge from Access
Hi Gary,

I haven't tried this in a while, but how about if you automate the MailMerge
as well.  Would setting the Destination property of the MailMerge object
help any??

--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------

:OK, here's what I'm trying to do.  I have made a search form in Access that
:allows a user to search by whatever parameters they want.  Once the user
had
:narrowed down their search they can click a "Merge" button.  This button
:runs a function that takes the current form filter and generates a randomly
:named Query and uses it to run acCmdWordMailMerge command.  Heres some code
:im using :
:
:With dbs
:        Set qdf = .CreateQueryDef(queryName, sqlString)
:        DoCmd.SelectObject acQuery, queryName, True
:        RunCommand  acCmdWordMailMerge
:        .QueryDefs.Delete qdf.Name
:        .Close
:    End With
:
:Notice that I delete the query when the runCommand is done.  I do this so
:when the database is being used by 50+ users -- there isnt several hundred
:temporary querys laying around.  I use these queries, since as far as I
:know, its the only object besides a table that will work with the
:acCmdWordMailMerge command.
:
:All of this works perfect.  Word starts with all the right Mail Merge
:settings/filter/etc.  The user can add/delete fields and merge and print
:their labels/form letters/whatever.
:
:However, heres the problem.  If the user saves his/her form letter in hope
:of using it later without having to recreate it, they cant.  Since, next
:time the user trys using/opening the templated word document he/she used
:before the old data source is gone since it was a temporary query that was
:deleted the first time around.
:
:Heres a few questions:
:
:Has anyone tried this type of automated Word MailMerge from Access before?
:If so how did you approach it?
:
:Are you familiar with the acCmdWordMailMerge menu command?  Is there anyway
:to pass it an SQL string?  Or anything?
:
:Is there a way to change the force update a datasource on a predefined Word
:MailMerge Document?
:
:Can someone think of a better way to do all of this?  Or point me somewhere
:that may have some info.
:
:Thanks for yout time,
:Gary Striano
:UCI GSM
:Administrative Computing
:
:
:



Sun, 04 Feb 2001 03:00:00 GMT  
 DAO Question Concerning a Word Mail Merge from Access
Your first post of this question got posted as an answer to "Access Forms
Lock SQL Server Tables".  Check my response there.
  - Turtle



Quote:
> OK, here's what I'm trying to do.  I have made a search form in Access
that
> allows a user to search by whatever parameters they want.  Once the user
had
> narrowed down their search they can click a "Merge" button.  This button
> runs a function that takes the current form filter and generates a
randomly
> named Query and uses it to run acCmdWordMailMerge command.  Heres some
code
> im using :

> With dbs
>         Set qdf = .CreateQueryDef(queryName, sqlString)
>         DoCmd.SelectObject acQuery, queryName, True
>         RunCommand  acCmdWordMailMerge
>         .QueryDefs.Delete qdf.Name
>         .Close
>     End With

> Notice that I delete the query when the runCommand is done.  I do this so
> when the database is being used by 50+ users -- there isnt several
hundred
> temporary querys laying around.  I use these queries, since as far as I
> know, its the only object besides a table that will work with the
> acCmdWordMailMerge command.

> All of this works perfect.  Word starts with all the right Mail Merge
> settings/filter/etc.  The user can add/delete fields and merge and print
> their labels/form letters/whatever.

> However, heres the problem.  If the user saves his/her form letter in
hope
> of using it later without having to recreate it, they cant.  Since, next
> time the user trys using/opening the templated word document he/she used
> before the old data source is gone since it was a temporary query that
was
> deleted the first time around.

> Heres a few questions:

> Has anyone tried this type of automated Word MailMerge from Access
before?
> If so how did you approach it?

> Are you familiar with the acCmdWordMailMerge menu command?  Is there
anyway
> to pass it an SQL string?  Or anything?

> Is there a way to change the force update a datasource on a predefined
Word
> MailMerge Document?

> Can someone think of a better way to do all of this?  Or point me
somewhere
> that may have some info.

> Thanks for yout time,
> Gary Striano
> UCI GSM
> Administrative Computing



Sun, 04 Feb 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. dao access word mail merge

2. Word Mail Merge Err - Word could not merge...

3. Formatting Merge Fields in Word Mail Merge

4. word mail merge question

5. Access/Word mail merge

6. e-mail from Access via does not send merged Word document

7. Access - Word Mail Merge

8. Automated Mail merge from access to word

9. Using Access to perform a mail merge in word

10. Word/Access mail merge automation help needed

11. Mail Merge word/access 2000

12. Automating Word Mail merge from a password-protected Access database

 

 
Powered by phpBB® Forum Software