Solved

Mail Merge - Guidance on how to mark records as merged

Posted on 2011-09-06
4
270 Views
Last Modified: 2012-05-12
Hi all -

So, here's my situation.

I have a SQL Server with a bunch of records. I need to create labels for the records. My department is always adding new records, and we're always needing to print more labels.

I created a Word 2007 mail merge document that creates such labels, and filters on a boolean (bit) field called LabelPrinted.  So, all my coworkers need to do is open the Word document, hit merge, and boom, done.

However, I am stuck at how to then mark the records as LabelPrinted=true

Can someone point me in the right direction for the most efficient and smoothest way to do this?

Is there some built in function within Word to do this? Or do I need to resort to VBA code? Or something else?

If VBA, what logic should I use? I'm experienced with VBA from Excel... I'm sure I can stumble through Word with some guidance.

I hope that all makes sense. I'm just looking for a starting point as to how I should go about this... I want to figure out the nitty gritty myself.

Thanks!

0
Comment
Question by:Castaway78
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:BusyMama
ID: 36492937
I don't think there is a built-in function in Word for this.  I would go with VB - I have updated database records using VB in Excel and I am sure Word would be quite similar.

It sounds like you don't want specifics so I won't post any, but if you want more detail let us know.

Good luck!
0
 

Author Comment

by:Castaway78
ID: 36492990
Okay, so with VBA... how would I go about doing that?  (The actual code that does the SQL Update I'm good with)

Is there a AfterMerge event, or something similar that I could use to trigger the update? I'm just trying to figure out how I would go about doing that?

Or would I need to create a custom interface that starts the merge and updates the SQL all in one?
0
 
LVL 7

Accepted Solution

by:
BusyMama earned 125 total points
ID: 36493028
There is an AfterMerge event, and I'm assuming you are already using VBA to call the database and record set (Dim db as database, rs as recordset, or similar ...), so you can update the batch of records that are already identified.
0
 

Author Comment

by:Castaway78
ID: 36493039
The recordset is being called via the merge itself... at this point, I haven't created any VBA code.

So, it's looking like putting in an Update command into the AfterMerge event will work nicely.

Thank you!
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

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
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 video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…

910 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