![]() |
#14
|
||||
|
||||
![]()
Hi Jennex,
Quote:
{QUOTE {SET ss{=ROUND({MERGEFIELD Time}*86400,0) \# 0}} {SET hr{=INT(ss/3600)}} {SET mn{=INT((ss-hr*3600)/60)}} {QUOTE"{=IF(hr=0,12,hr)}:{mn}" \@ "h:mm "}{IF{=hr}< 12 a.m. p.m.}} FWIW, the macro in the link you referred to is one I wrote. Quote:
1. Insert a SKIPIF field into the mailmerge main document, so the unwanted records are filtered out; or 2. Modify the SQL statement. The former is easier for end-users to work with and could be coded like: {SKIPIF{MERGEFIELD CONTRACT}<> {FILLIN "Contract to include." \o}} or: {SKIPIF{MERGEFIELD CONTRACT}= {FILLIN "Contract to exclude." \o}} or even: {SKIPIF{IF{FILLIN "Contract to include/exclude." \o }={MERGEFIELD CONTRACT} 0 1}= {FILLIN "1: include. 0: exclude." \o}} If you'd prefer to do the filtering via the SQL, though, you'd need to hand-code that part, along the lines of the 'where 'Type$'='FR' And 'SubResp'='WPL1' ' in the code in your post. The 'ORDER BY' portion is simply the SQL equivalent of the sort order you'd apply in Word, though even this isn't needed if the data are sorted that way in the data source. Regarding your remaining issues: 1. You can overcome the header mergefield issue via the use of SET fields in the body and REF fields in the header. See attached (I've made a variety of changes to the header and the first row of the table in the body). I haven't included the field code for the time manipulations as the document works fine for me without it. 2. Try the attached document - if it works, this ceases to be an issue; if not, we can come back to it. 3. Does the SKIPIF approach above (but with your 'Type' or 'SubResp') do as you need? If you need to be able to use both, I can code a field for that, too.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Switches | ilovemypuppy | Word | 2 | 02-08-2012 04:28 PM |
![]() |
cksm4 | Word VBA | 2 | 02-03-2011 07:21 AM |
Mail merge switches | Jan Collier | Mail Merge | 0 | 08-29-2010 06:06 AM |
Command Line Switches | Ringmaster | Office | 0 | 08-10-2010 06:27 AM |
Help with switches: Word mail merge with Excel | ks_ | Mail Merge | 0 | 12-09-2009 05:09 PM |