Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-01-2018, 03:54 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: 22,467
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 Cold in Skagway View Post
If I did succeed it getting this to work, I would have to save it as a ".doxm" correct?
Would the person(s) wanting to use this form also have to have the macro installed and have to run it every time they fill in the info, or would it be automatic?

Please understand, the less clicks and fiddling around to get the form filled out and printed with the info the better.
If you were to save the document as a dotm template, double-clicking on that would allow the user to create a docx file that has full access to the code that drives the process. Alternatively, if the users are unlikely to have access to the template, you could distribute a docm document such as the one attached to post #2.

Whether the macro runs automatically in the case of a docm document largely depends on the user's macro security settings. With the template approach, that's not an issue.

As for "the less clicks and fiddling around to get the form filled out", all the user need do is select the appropriate entry from the dropdown and the output will be generated/updated as soon as the dropdown is exited. It could hardly be any simpler than that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 04-11-2018, 10:45 AM
GregClaessens GregClaessens is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Apr 2018
Posts: 2
GregClaessens is on a distinguished road
Default Multiple values in different areas upon a single drop down selection.

Hi, my first post. Thanks to all for the effort.

I am making a template to analyze the legal position of potential clients facing residential evictions. I found this forum and thread because I wanted to be able to embed in my analysis document a drop down list from which to choose the type of eviction at hand. I want that selection to then generate for me the legal notes I have related to that type of eviction. The solutions posted here totally work and I am very happy with it. But now I am wondering if I could do more.

What I would like is to still have a single drop down to select eviction type, but I would like multiple output boxes with multiple values attached to the eviction selection. Specifically I want to be able to select the [eviction type] and see in one part of the document the {legal notes and elements} for that eviction type and then in another box the {notice requirements} for that eviction type.

I am pretty sure that this type of functionality could be created but I wonder if this solution is not the right way to achieve it. I have seen some documents that draw from spreadsheets. Maybe a spreadsheet would be the better way to define the various values that come with the eviction type selection.

If this method is ideal how would I go about defining the additional values? If there is a better way i'd appreciate any input. One of the hardest parts about being a novice with these tools is not knowing how to ask the right questions.
Reply With Quote
  #3  
Old 03-31-2018, 09:07 PM
Guessed's Avatar
Guessed Guessed is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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

Beth

doxm is not a standard format. Perhaps you meant docm or dotm. The formats that end with m can contain macros. Your macros can exist in several possible templates or even the document itself in order to be available but if you are distributing the resulting documents AND those users need access to the macros then your options for storing the macros become more limited and you rely on them trusting you enough to enable the macros.

It is most efficient to store the macros in an 'attached dotm template' and save the new documents as docx with that template available to it.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #4  
Old 04-11-2018, 03:06 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: 22,467
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

To output different elements from a selected item to different content controls, see:
https://www.msofficeforums.com/word-...tml#post120392
in this thread.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-12-2018, 03:49 PM
GregClaessens GregClaessens is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Novice
 
Join Date: Apr 2018
Posts: 2
GregClaessens is on a distinguished road
Default

Thank you for the quick reply. So the solution presented in the example in post #71 ... am I correct that the function of the pipe "|"now serves to define the bounds of the different outputs as opposed to entering a line break?

That's neat, and I can imagine uses for that function in other projects but I don't think it is going to work here.

The ideal solution for my needs would be to: 1 select from a list of eviction types in one control box, 2 generate a legal elements outline for the selected type(would love if it could display in multi level list formatting, though this might be too much to ask), and then 3 generate a serious of questions contained in a table (geared to evaluate the validity of the eviction notice).

I might be asking too much of word. It occurs to me that I am basically trying to embed a chatbot in a word document. Maybe I should just figure out a chatbot with the ability to generate a report based on the entries provided.

[if anyone is interested... evictions and access to (affordable) legal help are a real problem in our county (Marion, OR). My firm (wife and I) are doing our best to offer really low cost eviction defense by basically having templated/processed out all of the different eviction representation variables that there are. The template I am working on would help us very quickly and therefore cheaply assist people facing evictions here.]
Reply With Quote
  #6  
Old 04-13-2018, 04:10 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: 22,467
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 GregClaessens View Post
The ideal solution for my needs would be to: 1 select from a list of eviction types in one control box, 2 generate a legal elements outline for the selected type(would love if it could display in multi level list formatting, though this might be too much to ask), and then 3 generate a serious of questions contained in a table (geared to evaluate the validity of the eviction notice).
In that case, I think you would do better to have as many separate eviction templates as you need, one each with all the boilerplate content for each eviction type, then simply choose the appropriate template for a given case. No code required, simple to maintain, and all formatting in-place as required.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 06-15-2018, 09:39 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 Output that contains form fields

Hi All,

This thread has been quite helpful; however, I have a more complex need.

I would like to have a drop-down selection auto-populate relevant paragraphs farther down in the document.

The paragraphs that I want to auto-populate already contain their own legacy form fields for dates and numbers, and some are cross-referenced.

Is it possible to make all of this work together?

Thanks,

Laura
Reply With Quote
  #8  
Old 04-12-2018, 04:23 PM
Guessed's Avatar
Guessed Guessed is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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

Greg

What you are asking is certainly in scope of what can be done in Word but it can be tricky to set up when there are lots of different parameters. Whilst you could do it following the guidance of this thread, it is probably not the easiest way to arrive at a solution.

I would be more inclined to do this by preparing a document which contains all content and then use a form to make selections and a macro which either hides or deletes the unwanted parts. All parts would be tagged in some way (either bookmarks, Content Controls or headings) so the code could show or hide them easily. I think this approach would be much simpler to create and maintain.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #9  
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: 22,467
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
  #10  
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
  #11  
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: 22,467
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
  #12  
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
  #13  
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: 22,467
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
  #14  
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
  #15  
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: 22,467
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
Reply

Thread Tools
Display Modes


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 07:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft