Solved

Mail Merge - Guidance on how to mark records as merged

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Suggested Courses

738 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