Solved

Only use the last record in an Excel sheet with a Word mail merge

Posted on 2016-08-24
5
46 Views
Last Modified: 2016-08-24
If I have an Excel sheet and I want to set up a mail merge so that it only picks up the last record entered...how do I set that up? Thanks
0
Comment
Question by:agwalsh
5 Comments
 
LVL 20

Assisted Solution

by:n2fc
n2fc earned 125 total points
ID: 41768348
After setting up the mail merge, use the "Select Recipients" and "Edit Recipient List" buttons to select ONLY the last entry...

See: https://support.office.com/en-us/article/Mail-merge-using-an-Excel-spreadsheet-858c7d7f-5cc0-4ba1-9a7b-0a948fa3d7d3

... for a more detailed explanation & tutorial video...
0
 
LVL 32

Assisted Solution

by:Rob Henson
Rob Henson earned 125 total points
ID: 41768362
If this is to occur on multiple occasions and on each occasion you want to only send mail to new entries into the list, I would add a field into the Excel sheet for "Mail Sent" and update the list each time mail is sent with a Y.

This field can then be used as a filter in the Mail Merge to filter the recipients to only those with blank in the Mail Sent field.

Thanks
Rob H
0
 
LVL 17

Accepted Solution

by:
xtermie earned 250 total points
ID: 41768369
You can do your merge for selected records only
From your main document, go to the Mailings tab of the ribbon
Select the last record using the |> button
Do your merge for the last record only in Finish & Merge, by choosing current record only

If you want to automate this, you can use a macro (and assign it to a button on the quick access toolbar maybe in the document you have)
Sub mergelastrecord()
Dim wdOutputName As String
Dim wdInputName As Document
Dim x As Integer

Const wdDefaultLastRecord = 10 '(set last record)
wdOutputName = ThisDocument.Path & "\MyForm2.docx"
Set wdInputName = Application.ActiveDocument

With wdInputName.MailMerge
    .Destination = wdSendToNewDocument
    .SuppressBlankLines = True
    With .DataSource
        .LastRecord = wdInputName.MailMerge.DataSource.RecordCount
    End With
    .Execute Pause:=False
End With

' show and save output file
Application.Visible = True
Application.ActiveDocument.SaveAs wdOutputName

' cleanup
wdDoc.Close SaveChanges:=False
Set wdDoc = Nothing

End Sub

Open in new window

0
 

Author Comment

by:agwalsh
ID: 41768462
Thanks to all of you. Excellent variety of possible solutions..
0
 

Author Closing Comment

by:agwalsh
ID: 41768464
Excellent variety of solutions for users at different levels. Thanks as always - knew EE would come through :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
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…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

919 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

14 Experts available now in Live!

Get 1:1 Help Now