#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
That is an odd problem and the error message is not factually correct. It is unhappy because the selection is inside a dropdown CC but it works happily if the selection includes the full CC or is sitting outside of the CC. As you say, it makes no sense since the failing command isn't obviously using the selection anyway.
It appears you need to move the selection somewhere, what about selecting the CC range earlier? Code:
Set oRng = oCCList.Range oRng.Select
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Yes it is an odd one!
"Or you could always fall back on the macro being kicked off when you exit the CC" Come on Andrew! Where is the fun in that? Attached file updated illustrating a third method. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difficulties with replacing certain language-specific characters using VBA. | Franci | Excel Programming | 3 | 05-28-2018 01:20 AM |
Difficulties with opening the word file | AlbertaSergio | Word | 1 | 02-16-2018 02:15 PM |
Access/PPT VBA difficulties | Thompyt | PowerPoint | 7 | 03-06-2015 12:25 PM |
Difficulties with bullets in Word | Cityroller | Word | 1 | 02-24-2015 07:15 PM |
Random number difficulties | ahrinn | Word | 12 | 08-01-2012 01:04 PM |