Solved

Mail Merge - Guidance on how to mark records as merged

Posted on 2011-09-06
4
269 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

758 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

27 Experts available now in Live!

Get 1:1 Help Now