#1
|
|||
|
|||
Conditional Variables To Drive Output - Help Needed
Afternoon everyone
I have an excel mail merge problem I am hoping someone can confirm if it is possible, and if so how to do it. I am creating contracts for a large number of colleagues. I have the scripts written with blank spaces for the variables relevent to each colleague. Naturally not all paragraphs will be applicable to each colleague. Rather than have all the letters created, and have to delete the unwanted paragraphs, I'm looking for the contract script not to generate the obsolete paragraphs at all. I have created a variable for each paragraph, and have broken down the paragraphs into variable chunks e.g. "Your salary is changing from xxxx to xxxx" Variable 1 contains "Your salary is changing from", Variable 2 contains "to" With variables "Pre Salary" & "Post Salary". My logic in doing it this way is that I can edit the code (and I apologise for my basic understanding of coding language) to read: (If "Variable 1" <> "", and "variable 2" <> "", and "Pre Salary" <> "", and "Post Salary" <> "" then output "Variable 1", "Pre Salary", "Variable 2", "Post Salary", else ""). Can anyone help me with this? Regards, |
#2
|
||||
|
||||
Hi tamrichardson,
This is certainly possible, using a field code like: {IF{={IF{MERGEFIELD Variable_1}= "" 0 1}*{IF{MERGEFIELD Variable_2}= "" 0 1}*{IF{MERGEFIELD Pre_Salary}= "" 0 1}*{IF{MERGEFIELD Post_Salary}= "" 0 1}}= 1 "{MERGEFIELD Variable_1}, {MERGEFIELD Pre_Salary}, {MERGEFIELD Variable_2}, {MERGEFIELD Post_Salary}"} Note: The field brace pairs (ie '{ }') for the above example 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. You can download a macro for converting the above to a working field, from: http://www.gmayor.com/export_field.htm#TextToField
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Printing hi res images from powerpoint to pdf output? | miriamallen | PowerPoint | 0 | 02-29-2012 09:54 AM |
'If... then... else' - output dependent on multiple fields | SiBrad | Mail Merge | 3 | 01-13-2012 02:56 AM |
Input from excel, output to word | conradin | Word | 3 | 04-20-2011 07:48 PM |
Output Presentation Settings | yeapurvz10 | PowerPoint | 0 | 09-17-2010 10:30 AM |
Creating A Input Or Output Field | skoz55 | Excel | 0 | 08-15-2009 04:40 PM |