Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod
 
Posts: n/a
Default Using IF to find whether a Merge Field contains a substring

Hi Joshua,

This is easy enough to do with wildcards in the field coding if the
substring always starts at the same position in the overall string. For
example, if the substring to look for always begins at the 5th character:

{IF{MergeField MyData}= ????TestString* "True Result" False Result"}

For anything involving variable string positioning, a field-code solution
could be horribly complex.

Cheers


"Joshua Pangborn" wrote in
message ...
I am merging some letters, and I have a merge field that lists a number of
codes separate by new lines. I need to include another document if a
particular code is in the mergefield. I know that you can use IF

MergeField =
"string", but that returns false. I have tried IF MergeField = "*string*",
but that also returns false. Is there another way to test if a merge field
contains a string? Thanks. I can provide more information if needed.
--
- Joshua Pangborn



 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
merge letter with drop down form field Sarah Mailmerge 2 January 24th 06 11:33 PM
Suppressing Merge Field and text before/after julie Microsoft Word Help 8 November 14th 05 02:50 PM
Word merge field names vs. Excel merge field names [email protected] Mailmerge 5 November 11th 05 05:24 PM
Is it possible to use find replace for Merge Field data Chris Mailmerge 1 August 22nd 05 03:58 PM
Date Field in Merge Document Karen Hart Mailmerge 35 March 29th 05 12:38 PM


All times are GMT +1. The time now is 01:03 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"