Solved

Find data source in Word 2007 mail merge

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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

617 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