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
Solved

Find data source in Word 2007 mail merge

Posted on 2014-09-10
5
379 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
  • 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

789 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