Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #91  
Old 06-15-2018, 03:32 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

This thread concerns the use of content controls, not formfields, and you should not use content controls and formfields in the same document; they weren't designed to work that way and trying to do so can lead to inconsistent behaviour.

For formfields, see: https://www.msofficeforums.com/word/...html#post46429
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #92  
Old 06-18-2018, 06:37 AM
liger liger is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Jun 2018
Posts: 2
liger is on a distinguished road
Default Which would you recommend?

Thank you, I am looking at it now.

I am trying to create letters that can auto-fill multiple paragraphs per drop-down selection, and within these paragraphs, there are currently form fields. Is this even possible?
Reply With Quote
  #93  
Old 06-18-2018, 03:56 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by liger View Post
Is this even possible?
Definitely - and really no harder than having a single word as the conditional output.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #94  
Old 06-25-2018, 01:10 PM
redjello1803 redjello1803 is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2013
Novice
 
Join Date: May 2018
Posts: 2
redjello1803 is on a distinguished road
Default Preventing Edits

Macropod,

I have read through this entire thread and have not seen my issue addressed.

I receive documents from multiple managers from across the country that I am trying to standardize. I have done this by enabling editing protections on the document itself and using text fields, a drop down list, and the date picker tool.

When I select an option from my drop down list the appropriate field populates with the correct information. However, a person can go back to that output field and edit the information in that field. I have turned on editing restrictions to prevent this from happening, but that causes the code that you attached at the beginning of this thread to malfunction and not work.

I want the users of this file to only be able to edit a few places and the drop down list output is not one of them.

Any help is greatly appreciated.

P.S. If you know how to restrict manual entry on the date picker and force the user to click the arrow to choose a date that would also be helpful.

Thank you
Reply With Quote
  #95  
Old 06-26-2018, 04:23 AM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use code like:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
  If .Title = "Client" Then
    If .LockContents = True Then Exit Sub
    For i = 1 To .DropdownListEntries.Count
      If .DropdownListEntries(i).Text = .Range.Text Then
        StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
        Exit For
      End If
    Next
    With ActiveDocument.ContentControls(2)
      If .LockContents = True Then Exit Sub
      .Range.Text = StrDetails
      .LockContents = True
    End With
    .LockContents = True
  End If
End With
End Sub
Do note that this will prevent anyone changing their selection & output unless both content controls are unlocked.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #96  
Old 06-27-2018, 11:51 AM
redjello1803 redjello1803 is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2013
Novice
 
Join Date: May 2018
Posts: 2
redjello1803 is on a distinguished road
Default

Thank you for your response.

When I copy the code into my document with the previous code still in it, I get an error about an ambiguous name. If I delete the previous code and copy/paste the code you just provided into my document, when I select an item from the drop down menu the second content control never populates and just stays blank,

I have tried fooling around with the code for a while and was unable to obtain the desired result.

Any guidance is greatly appreciated.

Also, did you have any insight into how to force the user to use the date picker tool while disabling manual entry?

Thanks
Reply With Quote
  #97  
Old 06-27-2018, 06:22 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by redjello1803 View Post
If I delete the previous code and copy/paste the code you just provided into my document, when I select an item from the drop down menu the second content control never populates and just stays blank,
That's most likely because you've already locked it.
Quote:
Originally Posted by redjello1803 View Post
Also, did you have any insight into how to force the user to use the date picker tool while disabling manual entry?
That's not possible. What you can do, however, is validate whatever has been input - both as a date and as to the date format.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #98  
Old 07-06-2018, 10:04 AM
VGW VGW is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Jul 2018
Posts: 7
VGW is on a distinguished road
Default

Where would I find the number of my content control? I applied the code however the other box is not populating.

I suspect that the reference is incorrect I am getting no errors.

That leads to a question on how the connect controls behave when inserted. Does the new one no matter where inserted on document become the highest number or are they numbered from beginning to the end?


Thank you for your input, I would give my age if I provided version and program that I used the last time I attempted VB. I found the content controls a welcome addition to word, (even more welcome when I figure out how to make them behave).
Reply With Quote
  #99  
Old 07-06-2018, 03:51 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The # is the relative position in the document. An alternative is to give the output control a tag or title and reference it via that. See, for example, post #71 in this thread: https://www.msofficeforums.com/word-...tml#post120392
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #100  
Old 07-10-2018, 08:03 AM
VGW VGW is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Jul 2018
Posts: 7
VGW is on a distinguished road
Default Thank you

I found my error, before I can delete the multiple outputs. I needed to modify the selection values and pipes.

I had named my boxes, for ease of use however, I am now updating to remove spaces (again for ease of use).

May I ask a follow-up question?

What is the best method to apply the same functionality to multiple sets of controls within the same document?

Last edited by VGW; 07-10-2018 at 10:48 AM.
Reply With Quote
  #101  
Old 07-10-2018, 04:32 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by VGW View Post
IMay I ask a follow-up question?

What is the best method to apply the same functionality to multiple sets of controls within the same document?
That depends. I suggest you start a new thread for that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #102  
Old 07-12-2018, 08:06 AM
tostrand tostrand is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Jul 2018
Posts: 4
tostrand is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
You could add the entries to a dropdown content control. As the dropdown only supports a single line per entry, the other data could be output to a plain text or rich text content control via an on_exit macro. See attached demo
I have opened this document and for some reason it doesn't give the information in the second content control. Does it work differently in Word 2016?

We have a form where we want the following:

If "To be processed" is selected in the dropdown list it should on a line below give information "We are including X amount of attachments" where X need to be a textbox.

Since this all is in a form.

Is this possible?

Many thanks

Tanja

Last edited by tostrand; 07-12-2018 at 08:07 AM. Reason: Enter my name
Reply With Quote
  #103  
Old 07-12-2018, 04:14 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It works exactly the same with Word 2016. Without actually seeing your document, it can be difficult for anyone 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]
Reply With Quote
  #104  
Old 07-12-2018, 11:47 PM
tostrand tostrand is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Jul 2018
Posts: 4
tostrand is on a distinguished road
Default

Hi Paul

Thank you for your quick reply.

Attached is the document and it is all in swedish so let me know if that is an issue and I will translate it.

When you open the document you will have a bold line saying "Vi bifogar samtliga handlingar – antal sidor sidor."
This is the information I want to see more or less when selecting "för handläggning" in the dropdown menu.
Attached Files
File Type: docm LO-Rättsskydd.docm (61.3 KB, 25 views)
Reply With Quote
  #105  
Old 07-13-2018, 05:30 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your document uses formfields, not content controls. The two are entirely different, so it's not surprising your not getting the desired results. For formfields, see: https://www.msofficeforums.com/word/...html#post46429
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple entries in dropdown lists 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

Other Forums: Access Forums

All times are GMT -7. The time now is 06:51 AM.


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