View Single Post
 
Old 07-08-2020, 07:39 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default CC Insert Difficulties

Hello members,

I've been tinkering lately with the built-in CustomXMLPart events. The most recent accomplishment is a template (attached) showing two methods to provide a variable (user defined) number of input fields.


When the user selects a number from one of the two dropdown lists, the defined number of variable data fields (plain text CCs or building block containing text and plain text CCs) is inserted the applicable rich text container CC. See first attached image.

The DDL CCs are mapped to a customXMLPart (See second attached image) and the built-in events of that CustomXMLPrt detect when the user makes a selection.

For example, if the user selects "4" in the first DDL tagged "Number_of_children" then four plain text CCs are inserted in the richtext CC "Children_Names" (sorry, there is a typo in the picture).

Here is my difficulty (See third attached image). It isn't the end of the world, but I can't figure out why (or how to avoid) I have so "Select" the defined range before I can "Add" the CC????
If you Stet Out the oRng.Select line then the next line throws and error complaining that a CC can't be inserted. Perhaps I can't see the tree for the forest and hoping a fresh set of eyes may see something obvious. Thanks and functioning file is attached.
Attached Images
File Type: jpg CCs.jpg (65.7 KB, 16 views)
File Type: jpg CXPart.jpg (30.0 KB, 15 views)
File Type: jpg Trouble spot.jpg (68.2 KB, 15 views)
Attached Files
File Type: dotm Variable Number of CC Input Fields (2 Methods Demonstrated) Ver 1.2.dotm (47.5 KB, 5 views)
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote