![]() |
|
#1
|
|||
|
|||
![]()
Good day!
I am hoping somebody can help with my mail merge inquiry. I am trying to print IDs using MS Word. I separated the file for the front and back of the ID and there should be 3 sets of IDs per file. The back part of the ID should be in a different order than the front. Please see the sample below. 1 2 3 6 5 4 I have seen one solved thread that used a macro, but it only worked for 2 columns. See the macro codes below for reference. Code:
Sub MailMergeToDoc() Application.ScreenUpdating = False Dim Tbl As Table ActiveDocument.MailMerge.Execute For Each Tbl In ActiveDocument.Tables With Tbl .Columns(2).Select Selection.Copy .Columns(1).Select Selection.Paste .Columns(3).Delete End With Next Application.ScreenUpdating = True End Sub Last edited by macropod; 11-11-2024 at 01:35 AM. Reason: Added code tags |
#2
|
||||
|
||||
![]()
Please upload a copy of the document you want to modify. You can do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Thank you for your reply. As instructed, please see the attached files. The ID Template - Back file has a Macro code which I saw from another thread.
|
#4
|
||||
|
||||
![]()
Your documents won't work as required.
For starters, your 'front' document doesn't even contain a table - just masses of textboxes in three groups. And, although your 'back' document contains a three-column table, it, too, contains textboxes in each cell. You need to remove all textboxes and manage the content layout within each cell. Also, for a label merge, all you need do is get the layout correct in the first cell, then use 'Update Labels' to propagate the layout to the remaining cells. Are you using a particular label product supported by Word for this? If so, what is it?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
Hi!
I just make the 'Front' file as is with labels since it work with the 'Next Record' rule to populate other IDs with the other person's data. For the 'Back' file, I have attached the file with no textbox. My concern is if I print out these two files, the data of the 'Back' file will not mirror what it should be of the 'Front' file. if no Macro it will be, Front - 1 2 3 Back - 3 2 1 with the current macro, it's Front - 1 2 3 Back - 1 2 1 What I want is, Front - 1 2 3 Back - 1 2 3 And I'm not using any particular label product supported by Word. I hope I explained everything clearly. ![]() |
#6
|
||||
|
||||
![]()
Both files need to use a table, not textboxes.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
Here you go, I'm sending them all 3 files again. Don't mind the format. I'll format it again once everything's worked out.
![]() |
#8
|
|||
|
|||
![]()
I expect that you will find this easier if you use one of the Word label setups.
Labels, in Word are tables formatted to match commercial formats. |
#9
|
||||
|
||||
![]()
The simplest way of dealing with your problem is to use 'Legal' size stationery, with three paired labels per page, with each pair generating both sides of the label.
See attached. The result is achieved by nesting a second two-row table in the cells of the main table and changing the text orientation. The mailmerge is done as a label merge.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
![]()
Thank you for this. But if I use it, I will have to cut and separate the front and back of the ID, paste them back to back, and then laminate them. Is there a Macro that can make it work with 3 IDs per sheet? It worked with 2 per sheet so I was hoping there's also a workaround to make it work with 3 per sheet.
|
#11
|
||||
|
||||
![]()
You won't need to cut & paste anything. All you'll need to do is fold each front/back pair down the middle then laminate. You can even use the table tools to change the text direction for one side of the label in the mailmerge main document, if you like. Much less work and far more reliable than messing around with front & back mailmerges, remembering which way up & around to feed the first print into the printer, having to worry about whether the front & back align properly when printed, etc.
But, if you're absolutely wedded to using a macro: Code:
Sub MailMergeToDoc() Application.ScreenUpdating = False Dim Tbl As Table, Rng As Range, c As Long ActiveDocument.MailMerge.Execute For Each Tbl In ActiveDocument.Tables With Tbl For c = .Columns.Count - 1 To 1 Step -1 .Columns.Add Set Rng = .Columns(c).Cells(1).Range Rng.End = Rng.End - 1 .Columns.Last.Cells(1).Range.FormattedText = Rng.FormattedText .Columns(c).Delete Next End With Next Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#12
|
|||
|
|||
![]()
WOWWW! The below code worked as required! Thank you! Cut and Paste or folding is out of my choices since I will be using thicker paper. So combining sheets will just add up to the thickness.
THANK YOU VERY MUCH! ![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
mtandino | Word | 4 | 06-01-2021 02:00 PM |
![]() |
sureshbvs | Word VBA | 1 | 03-12-2021 05:42 AM |
![]() |
djrexy | Mail Merge | 1 | 05-20-2020 04:04 PM |
Update & Unlink Specific Merge Field in Word Doc from Mail Merge - Excel VBA | RMerckling | Mail Merge | 16 | 05-17-2018 05:19 PM |
Mail merge how to link mail merge field value to a column heading | dsummers | Mail Merge | 1 | 05-08-2014 02:59 PM |