#1
|
|||
|
|||
Content Control Fields - IF Statements
Hello to everyone,
I have a merge document with multiple Content Control Fields. Fields are populated from SQL database. Is there any way to insert if statements in the Content Control Fields? Additionally, I would like to change the date format from yyyy/mm/dd to dd/MM/yyyy. Any help would be greatly appreciated. |
#2
|
||||
|
||||
Content Controls are not fields. Please clarify.
You should also read the numerous articles in the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
It is Rich Text Content Control.
I didn't find something relevant for Rich Text Content Controls in Mailmerge Tips & Tricks. Is it possible to insert if statements and to edit the format of values such as currency and date? Docs are populated from SQL database. |
#4
|
||||
|
||||
You can change the type of control from rich text to date and set the date format as required, but you will lose the existing value if you change the type.
You would need a macro to resolve the value of the control.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
||||
|
||||
So why are you using a Content Control for a mailmerge instead of using a mergefield?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Quote:
The docs have already been in live production on a CRM core system. We are trying to fine tune them in order to minimize user's modifications upon their release. I was just wondering if there is a way to insert if statements or to create nested Content controls. |
#7
|
||||
|
||||
It is not possible to embed a Content Control in a Field of any kind and have the Content Control survive the merge. Mergefields can be embedded in Content Controls, however, such that a Content Control will display the embedded Mergefield's result upon execution.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Ι see.
So, if i insert in the Content Control a statement such as: { if { [Alex1s85] }<> "" "Date: { [Alex1s85] \@"dd-MM-yyyy" }" it will work? |
#9
|
||||
|
||||
What is [Alex1s85]?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
[Alex1s85] is the the content control's bookmark.
|
#11
|
||||
|
||||
So what does this have to do with a mailmerge?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#12
|
|||
|
|||
Please move the thread or delete it.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Importing content control data from excel and populate two fields on selected dropdown | badarlodhi | Word VBA | 8 | 02-08-2023 10:47 AM |
Content Control Dropdowns - How to duplicate the content control and allow a second choice | ashleyf | Word VBA | 2 | 03-19-2020 09:11 AM |
How can I set up tab to go back and forth between legacy fields and content control fields in a Word | Ikajed | Word | 1 | 10-13-2017 06:06 PM |
making an email form in outlook that has restricted access and uses content control fields | ericc2728 | Outlook | 0 | 08-25-2014 11:19 AM |
Deleting a table from a content control -- preserving the content control | BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |