Solved

Find data source in Word 2007 mail merge

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now