The SKIPIF field should do what you want, but it must be the first field in the mail merge main document.
{ SKIPIF { MERGEFIELD Description } = "N-P*" }
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi
I've been working on a document that imports data from another program into Word 2010 using Mergefields and uses a field called description. With this description field I currently have a code that displays anything with "N-P*" as a blank. My goal is to be able to skip records that have "N-P*" in the description. I have had some success using the following code:
{ MERGEFIELD TableStart:Cost \* MERGEFORMAT }{ NEXTIF \* MERGEFORMAT {MERGEFIELD Description \* MERGEFORMAT } = “N-P*”}
This skips any costs with “N-P*” in the description, but won’t work if there are consecutive records with “N-P*” in the description.
I would like to be able to skip all records with "N-P*" in the description regardless of whether they are consecutive records or not.
Regards,
Linden
PS. I have also tried using SKIPIF without any success
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
The SKIPIF field should do what you want, but it must be the first field in the mail merge main document.
{ SKIPIF { MERGEFIELD Description } = "N-P*" }
Hi Doug,
Thanks for your reply
I've had a go at trying the SKIPIF field, it sounds exactly like what I want, but for some reason I cannot get it to work. Is the TableStart field which I'm using before it creating problems for SKIPIF?
eg. { TableStart:Cost }{ SKIPIF { MERGEFIELD Description } = "N-P*" }
From where does the { TableStart:Cost } come? I know of no such field in Word.
I note that in your original post you mentioned a { MERGEFIELD TableStart:Cost \* MERGEFORMAT }
Do you have a field in the data source with the name of TableStart:Cost ?
Regardless, you will note from my response that I said that the SKIPIF field .... MUST BE THE FIRST FIELD IN THE MAIL MERGE MAIN DOCUMENT.
If you need it, you have use the { MERGEFIELD Description } elsewhere in the document, BUT, the
{ SKIPIF { MERGEFIELD Description } = "N-P*" }
MUST BE THE FIRST FIELD IN THE MAIL MERGE MAIN DOCUMENT.
As Doug said, the SKIPIF field should be the first field in the document. So you should be using:
{ SKIPIF { MERGEFIELD Description } = "N-P*" }{MERGEFIELD TableStart:Cost }
or:
{ SKIPIF«Description» = "N-P*" }«TableStart:Cost»
Note: The field brace pairs (ie '{ }') for the above examples are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message. Likewise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge fields dropdown.
Sorry the { TableStart:Cost } was meant to be { MERGEFIELD TableStart:Cost }
The information is getting pulled from a cloud based program on the web
The fields I have set up in a table
The table requires TableStart and TableEnd fields to build statement lines
So the coding looks like:
Item Qty
{ MERGEFIELD TableStart:Cost }{ SKIPIF { MERGEFIELD { MERGEFIELD Quantity }
Description } = "N-P*" }{ MERGEFIELD Description } { MERGEFIELD TableEnd:Cost }
This is what the merged document prints like
Item Qty
Cabinet 2
Bench Top 1
N-P Delivery 1
I am trying to get it to skip printing the items with N-P in the description
I have tried using SKIPIF as the first field before the Table:Start:Cost field but nothing seems to work, it just prints everything:
{ SKIPIF { MERGEFIELD Description } = "N-P*" }{ MERGEFIELD TableStart:Cost }{ MERGEFIELD Description }
{ SKIPIF { MERGEFIELD TableStart:Cost }{ MERGEFIELD Description } = "N-P*" }
I hope this makes sense.