Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-08-2020, 07:39 AM
gmaxey gmaxey is online now CC Insert Difficulties Windows 10 CC Insert Difficulties Office 2016
Expert
CC Insert Difficulties
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,422
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
  #2  
Old 07-12-2020, 02:42 AM
Guessed's Avatar
Guessed Guessed is offline CC Insert Difficulties Windows 10 CC Insert Difficulties Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Or you could always fall back on the macro being kicked off when you exit the CC
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 07-12-2020, 06:41 AM
gmaxey gmaxey is online now CC Insert Difficulties Windows 10 CC Insert Difficulties Office 2016
Expert
CC Insert Difficulties
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,422
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

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.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
CC Insert Difficulties 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
CC Insert Difficulties Access/PPT VBA difficulties Thompyt PowerPoint 7 03-06-2015 12:25 PM
CC Insert Difficulties 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:19 PM.


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