#1
|
|||
|
|||
VBA error Content Control On Exit
Hi, have attached form with vba error. Trying to combine OnExit code.
My preference is to parse dropdown method onexit Content Controls. If I select display value "Fred Smith" I would prefer that the "Email" address is inserted fsmith@gardens.com not display name "Fred Smith" and then "Name" content control is filled in at end of document using "Display value" or parse value "Name". Is this easier. I altered my parsed listed to be: Display Value Value email address fred smith|xxx|xxxx email address john smith|xxx|xxxx Would prefer to be able to use below format: Fred Smith fsmith@gardens.com|Fred John Smith|0555 111 222 When display value is selected the Email address is inserted not the display value in most cases. Then the Name (which is display value in this case) is inserted in "Name" content control at end of document. What is best approach please? ? jec Last edited by jec1; 08-15-2014 at 11:41 PM. |
#2
|
||||
|
||||
Without wanting to place too fine a point on it, you've omitted 'ActiveDocument' before '.SelectContentControlsByTitle'.
PS: Instead of providing links to other sites, which makes accessing those files subject to the vagaries of how those other sites are running, please attach directly any files relevant to this forum. You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Macropod well what can I say doh! Removes error but won't place Name CC content. That is fixed I now get a SHIFTTABKEYS error intermittently. Thank you.
|
#4
|
||||
|
||||
There are still some pretty basic issues to deal with, such as :
lbl_Exit: Exit Sub as the 2nd & 3rd lines in your ContentControlOnExit sub. In other words, it exits without ever even trying to do any processing...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Yes correct. I am combining two pieces of code. I will do my dropdowns one at time if I can't combine the codes without too much fiddling.
Thank you for help. |
#6
|
||||
|
||||
If your dropdowns are meant to respond to the updates of more than the one content control, though, they'll need to share the same ContentControlOnExit sub, so you'll need to incorporate the logic for each one into that - you can't have more than one ContentControlOnExit sub.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Move to next content control | cksm4 | Word VBA | 13 | 07-02-2019 07:48 PM |
Deleting a table from a content control -- preserving the content control | BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |
Content control problem | Anja | Word | 2 | 10-16-2013 09:56 AM |
Hierarchical content control | ntjson | Word VBA | 1 | 04-04-2013 12:07 AM |
Content control titles | jillapass | Word VBA | 3 | 05-29-2012 06:11 AM |