![]() |
|
#1
|
||||
|
||||
![]() Quote:
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] |
#2
|
|||
|
|||
![]()
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. |
#3
|
||||
|
||||
![]()
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 |
#4
|
||||
|
||||
![]()
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] |
#5
|
|||
|
|||
![]()
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.] |
#6
|
||||
|
||||
![]() Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
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 |
#8
|
||||
|
||||
![]()
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 |
#9
|
||||
|
||||
![]()
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] |
#10
|
|||
|
|||
![]()
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? |
#11
|
||||
|
||||
![]()
Definitely - and really no harder than having a single word as the conditional output.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#12
|
|||
|
|||
![]()
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 |
#13
|
||||
|
||||
![]()
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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#14
|
|||
|
|||
![]()
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 |
#15
|
||||
|
||||
![]() Quote:
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] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
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 |