Results 1 to 4 of 4
  1. #1
    janthony is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    15

    Table Mail Merge - Is this possible?

    EDIT: Can any mods put this in the programming Sub? I think it should go there? Thanks in advance.


    Click image for larger version. 

Name:	Word Merge.png 
Views:	18 
Size:	44.9 KB 
ID:	19709

    When I press a button, I want to be able to run a VBA code that does a Word Merge (see picture above).

    The catch is that I want it to go straight from a specific Table as opposed to Queries or any other extra steps. I want the user to handle everything in Microsoft Word, as far as creating the message, selecting recipients, etc. after pressing the button. I am setting up this database to lock the user out of all back-end (tables, VBA code, etc.) so they won't have access to the table to be able to do this like I am doing here (selecting Table, then clicking the Word Merge button).

    I'm not even sure if this is possible. All my research has shown me so far is dealing with all kinds of complicated code that's far above my head. Is there a simple code I can run for this?

    Basically, the syntax I want is...

    Private Sub Button_Click()
    If DropDown.Value = "MASS MAIL" Then
    Run [Word Merge] from table [Member] <---- this is the part I am confused about
    Else
    End If
    End Sub



    ...and then the screen in the above picture pops up, and the user does the rest in Microsoft Word.


    Any advice would be appreciated!
    Last edited by janthony; 02-15-2015 at 10:26 AM.

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    * "I want the user to handle everything in Microsoft Word, as far as creating the message, selecting recipients, etc."
    -- Word cannot be the front end user interface for the Access database - for this you must use an Access form

    *" I am setting up this database to lock the user out of all back-end (tables, VBA code, etc.)"
    -- that is a common thing to do for Access databases, it has nothing to do with Mail Merge per se

    In general Mail Merge is the join of two separate applications; The Word Template is joined to the Access dataset.

    Use Access as the vehicle to select the variable set of data. Have the user directly go into Word to open that Template and control the boiler plate (not variable) language displaying on the template.

  3. #3
    janthony is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    15
    * "I want the user to handle everything in Microsoft Word, as far as creating the message, selecting recipients, etc."
    -- Word cannot be the front end user interface for the Access database - for this you must use an Access form
    I can see how this can be confusing now that you say this. I do understand the use of an Access to initialize the Mail Merge. What I meant was, once you get to the screen in the picture I attached, they would deal with everything from then on in Microsoft Word. I did not want a complicated process of form-to-form, etc. to be able to select users, etc.


    *" I am setting up this database to lock the user out of all back-end (tables, VBA code, etc.)"
    -- that is a common thing to do for Access databases, it has nothing to do with Mail Merge per se
    I thought this was relevant to say because I did not know the VBA code to initialize the Mail Merge. The only way I knew how was to click the actual button (which goes away once I lock out the user from the Access interface).


    *"In general Mail Merge is the join of two separate applications; The Word Template is joined to the Access dataset.

    Use Access as the vehicle to select the variable set of data. Have the user directly go into Word to open that Template and control the boiler plate (not variable) language displaying on the template."


    No offense, but I have no idea what this means. I do appreciate you taking the time to reply though

    I figured out how to do this. I just created a Macro (Open Table in Read Only/Print Preview -> WordMailMerge), and used the Access feature of Convert to VBA Code. This in itself was a valuable tool for me as I'm just learning. I just wanted to document the solution since someone might come across this.

    The provided code was rather simple...

    Private Sub Button_Click()
    If Me.cboAction = "Mass Mail" Then
    DoCmd.OpenQuery "Mass Mail", acViewPreview, acReadOnly
    DoCmd.RunCommand acCmdWordMailMerge
    Else
    End If
    End Sub

    This got me the pic of the screen I attached, but without needing the Access interface (using my own interface instead). Note: I decided to use a query instead of a table here afterall, there were many other fields in the table I did not want to show up.

  4. #4
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    Approach it this way: Use Access to collect the data (whether it be via a table or a query)

    Go into Word directly to set up the Template - its wizard will have you link to the Access data.

    Then when you change the data in Access; all you do is re-open the Word template and the data is changed.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Mail Merge
    By sakhtar in forum Access
    Replies: 8
    Last Post: 09-20-2020, 09:10 AM
  2. Help with Mail Merge please ?
    By bellevue in forum Forms
    Replies: 21
    Last Post: 02-16-2013, 07:05 AM
  3. Mail Merge
    By DCV0204 in forum Forms
    Replies: 6
    Last Post: 12-13-2011, 09:32 AM
  4. Mail Merge
    By Nixx1401 in forum Access
    Replies: 1
    Last Post: 02-15-2010, 10:51 AM
  5. Mail merge
    By grgerhard in forum Forms
    Replies: 0
    Last Post: 04-25-2006, 05:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums