#46
|
|||
|
|||
All Caps breaks the flow to the 2nd field
Hi, When trying this I could never get it to work in my document, although it worked fine in yours. I believe I have narrowed the problem down to this:
Within my document, an invoice, I want everything to be capitalized regardless of whether the user has Caps Lock on, so within font properties, I had All Caps selected. I found that turning off All Caps fixed the issue. I also found that on your example document, by selecting all and enabling All Caps, this also broke the information from appearing. Any thoughts as to why having All Caps on would break the information from appearing in the 2nd field? |
#47
|
||||
|
||||
This has nothing to do with whether the Caps Lock key is on or whether you're using All Caps but with whether you're calling the output content control with the correct name in the code -
CLIENTDETAILS is not the same as: ClientDetails In the code, the names are case-sensitive. As for capitalising whatever the ClientDetails control displays, that can be accomplished by changing: .Range.Text = StrDetails to: .Range.Text = UCase(StrDetails) though you should, perhaps, be capitalising whatever you're inputting into the 'Client' content control to begin with.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#48
|
|||
|
|||
Hi, your thoughts led me to some more experimenting.
Using your idea to capitalize whatever I'm inputting into the 'Client' content control to begin with, I have further narrowed it down to this: If All Caps is active, and the Display Names for your drop down are already all capitalized, it will work. If any letters of individual Display Names are not capitalized, those specific selections will not work, but selections that have all capitalized display names will. It appears that the capitalization of Values does not break this, even if All Caps is on, and you input value's have lower case letters, it will still work. |
#49
|
||||
|
||||
If you're using All Caps, that would impact the comparison being done via:
If .DropdownListEntries(i).Text = .Range.Text Then You can overcome that with: If UCase(.DropdownListEntries(i).Text) = UCase(.Range.Text) Then The above modification will work regardless of whether the particular content control's text is formatted as All Caps.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#50
|
|||
|
|||
Genius. Works perfectly now regardless of caps or no caps
|
#51
|
|||
|
|||
The original subject of this thread is covered in a fair amount of detail with working examples here: http://gregmaxey.com/word_tip_pages/...down_list.html
|
#52
|
|||
|
|||
Hey, I am trying to use this on a letter form. Is it possible to use to input from the dropdown in 2 different contentcontrols? For Example the dropdown is in a control called "Client" and then I have 2 content controls where the values from the dropdown is applied. One is called "Clientname", in this one the client name which is used in the dropdown already should be displayed again. The second contentcontrol should be called "ClientCode". In this one a client specific code should be shown.
So the value in the contentcontrol dropdown options should be something like this: Bank1 | Code: 1234abcd How to I apply this in the code from the first example? |
#53
|
||||
|
||||
That kind of thing has already been discussed, see, for example posts #9 & #19. As per the discussions in those posts, you could, for example, use code like:
Code:
ActiveDocument.ContentControls(2).Range.Text ActiveDocument.ContentControls(3).Range.Text Code:
With ActiveDocument.SelectContentControlsByTitle("ClientDetails") .Item(1).Range.Text = StrDetails .Item(2).Range.Text = StrDetails End With
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#54
|
|||
|
|||
Quote:
Is it possible to just use different parts of the string (f.e. Bank1 (Part 1) | abcd1234 (part 2) | Mr. Meyer (Part 3) ) in different contentcontrols? |
#55
|
||||
|
||||
That, too has been discussed.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#56
|
|||
|
|||
Quote:
Ive attempted to utilize your demo and am having an issue with a new drop down box being added to the doc... i have a dropdown cc named "Type" with a few choices within. I copied and pasted the dropdown cc onto the second page. What happens is, my macro runs, the value changes per the macro; however, the first dropdon cc is not changed, the second is changed and a third dropdown cc magically appears. Perhaps you can assist me with solving my issues? Please let me know. Many thanks |
#57
|
||||
|
||||
Without actually seeing the problem document, it's impossible to diagnose the issue. Can you attach the document to a post (delete anything sensitive)? 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] |
#58
|
|||
|
|||
Hi Macropod,
I've read through the entire thread, and didn't see anything about the issue I'm having. If I change the data in your original list boxes, this works fine. As soon as I put the list box and macro into my document, saving as a .docm, the macro does not run. I even tried building all of my text & form fields around yours, and it still wont' work. Any suggestions would be greatly appreciated! Thanks! |
#59
|
|||
|
|||
Ha ... I surprised myself and figured out my problem. Here is the (my) solution, in case anyone else runs into the same issue.
I was not changing "ActiveDocument.ContentControls(11).Range.Text = StrDetails" to reflect the actual content item. I've changed it from 2 to 11, and it works perfectly now! Thank you for all of your previous comments; they will help me immensely as I stumble through this project! Dawn |
#60
|
|||
|
|||
Paul,
I do not see any macro code to copy. Is there someplace special I should be looking for the code? Tim M |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Delete Multiple Entries | dudeabides | Office | 1 | 07-04-2011 02:49 AM |
Multiple task lists and multiple calendars | kballing | Outlook | 0 | 01-18-2011 10:23 AM |
Creating Multiple Contact Lists | meltee78 | Outlook | 1 | 01-03-2011 09:45 PM |
multiple calendar entries across a group | halfhearted | Outlook | 0 | 10-11-2009 12:13 PM |
Word Forms : Dropdown lists | wferaera45 | Word | 0 | 04-06-2006 03:02 AM |