Solved

Find data source in Word 2007 mail merge

Posted on 2014-09-10
5
390 Views
Last Modified: 2014-09-19
EE,
I have a mail merge document in Word 2007 that was setup a few years back.
It grabs the data from an Access database and then creates personalized emails that are sent through Outlook.

I would like to know how to find the data source so that I can do some altering.

Any help would be greatly appreciated.
dresdena1
0
Comment
Question by:dresdena1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:rlarian
ID: 40315955
if you open the word doc, on the mailings tab you should be able to edit the recipient list.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 40316351
You can try this macro which should cover most types of datasource:
Sub ShowDataSourceDetails()
    Dim strMessage As String
    With ActiveDocument.MailMerge.DataSource
        strMessage = "TableName: " & .TableName
        strMessage = strMessage & vbCrLf & vbCrLf & "Name: " & .Name
        strMessage = strMessage & vbCrLf & vbCrLf & "QueryString: " & .QueryString
        strMessage = strMessage & vbCrLf & vbCrLf & "Connectstring: " & .ConnectString
    End With
    MsgBox strMessage
End Sub

Open in new window

0
 

Author Comment

by:dresdena1
ID: 40324087
Thank you for the prompt responses, sorry to have taken so long to get back to this.

rlarian - I am not interested in editing the recipients of the existing data source. I want to find it, copy it, alter it, and assign it to a new Mail Merge document.

GrahamSkan - My knowledge of the internal workings of Word is very limited, I have the Developer tab active in Word and I see Record Macro, but beyond that I am lost.

Any help would be greatly appreciated.
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 40324815
Here is a slightly tweaked macro;
Sub ShowDataSourceDetails()
    Dim strMessage As String
    With ActiveDocument.MailMerge
        If .MainDocumentType = wdNotAMergeDocument Then
            strMessage = "The active document in not a mail merge document"
        Else
            With .DataSource
                strMessage = "TableName: " & .TableName
                strMessage = strMessage & vbCrLf & vbCrLf & "Name: " & .Name
                strMessage = strMessage & vbCrLf & vbCrLf & "QueryString: " & .QueryString
                strMessage = strMessage & vbCrLf & vbCrLf & "Connectstring: " & .ConnectString
            End With
        End If
    End With
    MsgBox strMessage
End Sub

Open in new window

You can run any macro thus:

Open the VBA editor with Alt+F11.
Select the Normal project in the project explorer pane (upper left).
Insert a Module using the Insert menu.
Select and double-click the new module in the project explorer pane.
Copy and paste the code into the code pane (upper right).
Put the text cursor somewhere in the code and press F5 (run)
0
 

Author Closing Comment

by:dresdena1
ID: 40332259
PERFECT! Thanks very much!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question