Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Mail Merge

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-04-2019, 08:32 AM
tommatwalker tommatwalker is offline Windows 10 Office 2016
Novice
 
Join Date: Jul 2018
Posts: 5
tommatwalker is on a distinguished road
Default Use of the SkipIf Function

Hi all,



I am currently attempting to use mail merge to generate a number of tables in a document. I need to generate a table but not add a row where that row would be blank? I.e. where a certain piece of mail merge is empty then to ignore that entry and skip to the next row. I am lead to believe that this may be possible with SKIPIF but I can't seem to get this to do anything? I have included my code below:

{SKIPIF {MERGEFIELD step_45_7}=""}

I have added everything using Ctrl+F9 but am relatively inexperienced at this sort of thing so any advice is gratefully received!

Thanks

Tom
Reply With Quote
  #2  
Old 01-15-2019, 01:16 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

You can use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial, in the 'Sticky' thread at the top of this forum:
http://www.msofficeforums.com/mail-m...-tutorial.html
The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it.

Depending on what you're trying to achieve, the field coding for this can be complex. However, since the tutorial document includes working field codes for all of its examples, most of the hard work has already been done for you - you should be able to do little more than copy/paste the relevant field codes into your own mailmerge main document, substitute/insert your own field names and adjust the formatting to get the results you desire. For some worked examples, see the attachments to the posts at:
http://www.msofficeforums.com/mail-m...html#post23345
http://www.msofficeforums.com/mail-m...html#post30327

Another option would be to use a DATABASE field in a normal ‘letter’ mailmerge main document and a macro to drive the process. An outline of this approach can be found at: http://answers.microsoft.com/en-us/o...1-1996c14dca5d
Conversely, if you're using a relational database or, Excel workbook with a separate table with just a single instance of each of the grouping criteria, a DATABASE field in a normal ‘letter’ mailmerge main document could be used without the need for a macro. An outline of this approach can be found at:
https://answers.microsoft.com/en-us/...f-8642e46fa103
For a working example, see:
http://www.msofficeforums.com/mail-m...-multiple.html

The DATABASE field can even be used without recourse to a mailmerge. An example of such usage can be found at: http://www.msofficeforums.com/mail-m...html#post67097

Yet another option would be to use a macro to delete unused rows at the end of a standard merge. For an example of that approach, see: http://www.msofficeforums.com/mail-m...tml#post137121

Alternatively, you may want to try one of the Many-to-One Mail Merge add-ins, from:
Graham Mayor at http://www.gmayor.com/ManyToOne.htm; or
Doug Robbins at https://onedrive.live.com/?cid=5AEDC...43615E886B!566
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code to save to individual files and skipif function beefcake2000 Mail Merge 2 12-05-2017 03:19 AM
[Word 2016 for Mac] SKIPIF condition doesn't work rschnell Mail Merge 3 10-19-2017 02:01 PM
Restrict Editing function disable insert textbox function IanM_01 Word 5 11-21-2015 02:29 AM
#REF! Error in calling VBA function disappears when function is copied lcaretto Excel Programming 2 05-26-2014 07:19 PM
Word vs Excel (NEXTIF, SKIPIF mergefield) jerry00769 Mail Merge 3 04-30-2012 03:43 PM


All times are GMT -7. The time now is 11:17 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft