Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-10-2013, 09:11 AM
tamrichardson tamrichardson is offline Conditional Variables To Drive Output - Help Needed Windows XP Conditional Variables To Drive Output - Help Needed Office XP
Novice
Conditional Variables To Drive Output - Help Needed
 
Join Date: Jan 2013
Posts: 1
tamrichardson is on a distinguished road
Default 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,
Reply With Quote
  #2  
Old 01-29-2013, 07:08 PM
macropod's Avatar
macropod macropod is offline Conditional Variables To Drive Output - Help Needed Windows 7 64bit Conditional Variables To Drive Output - Help Needed Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply



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
Conditional Variables To Drive Output - Help Needed 'If... then... else' - output dependent on multiple fields SiBrad Mail Merge 3 01-13-2012 02:56 AM
Conditional Variables To Drive Output - Help Needed 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft