|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
to print tickets the owner must always be in the same row regardless of previous items
I am printing exhibitor tickets using mail merge. The length of the data in the merge fields varies in length depending on the items being exhibited. But the row in the lower part of the ticket must always be in the same row regardless of how many rows are above.
Is there any way to anchor a row so that it does not move up or down regardless of the number of rows above? The merge file prints on a pre-printed form (TicketForm.pdf). In the merge file each sheet is a table with two rows with three tickets per row. At first I tried making the claim ticket its own row, which kept it in place, but the exhibitor name and ID would update to the next exhibitor before all the previous exhibitors items were listed. There are normally 800 to 900 entries in the fair, and I have to fix each ticket manually unless there is a way to anchor that row. I am not a sophisticated user, but can usually mange to find a way to solve a problem. Any help would be appreciated. Files: 1) Merge2021_TicketChildOrange.pdf, the Word merge file 2) 2021_TicketChildOrange.pdf, the resulting output. Notice the ID line moves up or down depending on the length of the data for each merge item. 3) TicketForm.pdf |
#2
|
||||
|
||||
I suspect there is no simple way to address this during the merge, however should be simple enough to produce a macro to ensure there were the appropriate number of empty paragraphs in each cell to produce the required spacing after the merge.
The following macro assumes that there are twelve empty paragraphs and four populated paragraphs at the top of each cell (including 1 value below the coloured line). Merge to a new document and then run the macro. Code:
Sub Macro1() 'Graham Mayor - https://www.gmayor.com - Last updated - 19 Sep 2021 Dim oTable As Table Dim oCell As Cell Dim oRng As Range, oLast As Range Dim i As Long, j As Long, k As Long, m As Long For Each oTable In ActiveDocument.Tables For Each oCell In oTable.Range.Cells Set oRng = oCell.Range j = 0: m = 0 For i = 1 To oRng.Paragraphs.Count If Len(oRng.Paragraphs(i).Range) > 2 Then j = j + 1 Else m = m + 1 End If Next i Debug.Print j & vbTab & m If j > 4 And m = 12 Then For k = 5 To j Set oLast = oRng.Paragraphs(oRng.Paragraphs.Count - 1).Range oLast.Delete Next k End If Next oCell Next oTable lbl_Exit: Set oTable = nothinh Set oCell = Nothing Set oRng = Nothing Set oLast = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
||||
|
||||
I would set up each ticket in two table cells rather than one. The paragraph of text that always needs to be in the same position goes into the second cell.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#4
|
||||
|
||||
See revised answer below
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
||||
|
||||
Quote:
What you could do to get around this is to use a SET field to record the value required in the upper cell and a REF field to reproduce the value in the lower cell. Thus in cell row 1 column 1 SET A { MERGEFIELD FIELDNAME } } cell row 1 column 2 SET B { MERGEFIELD FIELDNAME } } cell row 1 column 1 SET C { MERGEFIELD FIELDNAME } } Then for the lower cells Cell row 2 column 1 { REF A } Cell row 2 column 2 { REF B } Cell row 2 column 3 { REF C } Repeat from Row 3
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#6
|
||||
|
||||
OK, if two rows fail as you describe then more conceptual alternatives would be worth exploring.
I think the easiest alternative is to rotate the page to landscape, turn everything in the table cells 90 degrees. This will ensure both cells are populated before the nextRecord is reached. Perhaps using a frame for the lower text would work if each frame was anchored to the first paragraph in the cell Another alternative would be to slide on over to Microsoft Access to create the report
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
anchor, merge |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
creating tickets starting at 001 | mab5119 | Mail Merge | 1 | 02-07-2018 06:51 PM |
Change name of document owner when writing comments | Mark Laslett | Word | 2 | 08-25-2015 01:03 PM |
owner and delegate question for outlook 2013 | tik0pek205 | Outlook | 0 | 12-17-2014 08:02 AM |
tickets numbering | frenchyinpaddyland | Publisher | 0 | 04-27-2012 01:02 PM |
Sharing Calenders, How to delete a clander without an owner! | HeyRobi | Outlook | 0 | 05-15-2007 09:58 AM |