none
Linking text to a drop down menu selection. RRS feed

  • Question

  • Here is a quick overview of what I am trying to accomplish. I work for a Sheriff's Office and we constantly type up report after report and have naturally developed and saved low tech templates and narratives for common offenses. I have a working knowledge of word and understand the power it possesses so I began working on a master template. I have created a drop down menu for the afforementioned common offenses along with their corresponding statute number to save time when I started wondering the following:

    Is it possible to have my template load custom offense specific narratives when said offense is selected from the drop down menu?

    For example, I select Unoccupied Burglary 810.02(3b) from my drop down menu and below I magically load a narrative I previously prepared below the drop down menu that contain the elements of a burglary report which can now be edited to add specifics such as names and addresses.

    I am eager to figure this out so that I can save my zone partners and I a ton of time and to also establish uniformity in our reports so there are less kick backs due to overlooked or missing information. Any help would be greatly appreciated.

    Respectfully,

    Jason Parras

    Monday, May 23, 2011 11:15 AM

Answers

  • Jason,

    Actually that link was written by my friend Graham Mayor.  Graham's example is utilizes the legacy formfields controls.  The "Drop-Down Form Field Options" dialog is accessed by inserting and then dbl-clicking a legacy form field Dropdown field.  These legacy fields are found on the Develop Tab, Controls Group, Legacy Tools gallery.

     

    If you want to use the Word2007/2010 Content Control dropdown the after you insert and populate the dropdown you would select it and assign it a bookmark (you could use the bookmark name dropdown1 if you want).  Then to update the fields you would have to add a line of code in the ContentControl on Exit event:

    Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    ActiveDocument.Fields.Update
    End Sub

     

    For more on Content Controls see:  http://gregmaxey.mvps.org/Content_Controls.htm


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm
    • Marked as answer by Jason Parras Tuesday, May 24, 2011 1:16 AM
    Monday, May 23, 2011 9:53 PM

All replies

  • Jason,

    There are many ways to do this.  Specifically how you go about it would depend on your preferences and Word version.  Here are some ideas to get you started:  http://www.gmayor.com/SelectFile.htm


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm
    Monday, May 23, 2011 11:27 AM
  • Hello,

     

    This can be done by creating an Add-In. The Add-In could have a feature named "Create structure". The "Structure" could be a content control in which you will add the structure of the report, and when you save it, you take the OpenWordXML of the ControlControl and store it on a server. Then, anybody that uses that Add-In, uses the same database, could use it.

     

    You can find a lot of information on  this forum on how to achieve this.

     

    Hope it helps,

    Silviu.


    http://www.rosoftlab.net/
    Monday, May 23, 2011 12:23 PM
  • Mind: Blown.

    Thank you for your timely help and suggestions. I'm completely lost as to how to implement them as I am fairly green to this whole developing your own document thing but I am staring at my computer pressing buttons diligantly.

    Monday, May 23, 2011 7:25 PM
  • Mr. Maxey,

    I read your Select File walk through but I am not able to find a "Drop-Down Form Field Options" box like the one you used. I have Word 2007 and 2010 on my computers.

    Thank you for your time.

    Jason

    Monday, May 23, 2011 8:12 PM
  • Jason,

    Actually that link was written by my friend Graham Mayor.  Graham's example is utilizes the legacy formfields controls.  The "Drop-Down Form Field Options" dialog is accessed by inserting and then dbl-clicking a legacy form field Dropdown field.  These legacy fields are found on the Develop Tab, Controls Group, Legacy Tools gallery.

     

    If you want to use the Word2007/2010 Content Control dropdown the after you insert and populate the dropdown you would select it and assign it a bookmark (you could use the bookmark name dropdown1 if you want).  Then to update the fields you would have to add a line of code in the ContentControl on Exit event:

    Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    ActiveDocument.Fields.Update
    End Sub

     

    For more on Content Controls see:  http://gregmaxey.mvps.org/Content_Controls.htm


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm
    • Marked as answer by Jason Parras Tuesday, May 24, 2011 1:16 AM
    Monday, May 23, 2011 9:53 PM
  • Greg,

    Thank you again for your help. This is more complicated than I anticipated and I am still not accomplishing the task. My problem is making the macro work correctly particularly because I keep staring at this wall of code and being bewildered. I'll let you know if I figure it out.

    Jason

    Tuesday, May 24, 2011 1:19 AM
  • Hi Jason,

    Here's my 2-cents.

    With your custom template attached to a document, copy/paste/or type the narrative paragraph(s) of text. Once happy with the narrative, select it and click the Insert tab. Pull down on the button for Quick Parts and at the bottom of this list is a selection to "Save selection to Quick Parts gallery". Click that and for the Name field enter the 810.02(3b) or whatever name the officers will know the offense by (it could be 810.02(3b) - Unoccupied Burglary but there maybe a character length limit so just experiment), for the Gallery select AutoText and for the Save In choose your template name. When you close the document you'll be prompted to save the template, and do that.

    Now when the template is attached to any document, all the officer has to do is select Insert > Quick Parts > AutoText and they will see the list of offense descriptions to insert. If you want to automate this further with the names of the various offenses placed in a custom form listbox, this can be done referencing the unique names given to each auto text entry.

    The drop down menu that you've created where is it located and how is it opened by the officer? Is there a custom command bar button that is clicked, a form control button, etc?


    Wag and they wag with you, Howl and they put you outside. http://greatcirclelearning.com
    Tuesday, May 24, 2011 1:40 AM
  • Visit my site and send me a feedback.  I'll e-mail you a simple example.  May take me a day or so.

     

    P.S. Should I ever visit your parrish and happen to speed through I'll expect a get out of jail frree card ;-)


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm
    Tuesday, May 24, 2011 1:42 AM
  • Greg,


    I greatly appreciate your help! If you could make me a sample I could easily add stuff to then you would have diplomatic immunity.

    Jason

    Tuesday, May 24, 2011 4:00 AM
  • Thanks Mr. Michaels.

    Tuesday, May 24, 2011 8:41 AM
  • Rich,

    I considered a similiar approach but opted to suggest using InsertText fields and a separate document to list and edit the narrative descriptions.  I did this because I feel it is easier to edit and maintain the narratives. 


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm
    Tuesday, May 24, 2011 11:25 AM
  • Greg,

    That would probably be the easiest approach as it needs to be practically fool proof for others to be able/willing to use it. Also that would easily allow for changes or additions to be made if properly maintained. I am still stuck on the macros, irreverently failing over and over at making pre-made documents appear after drop down options are selected. How ever will I even distribute something so fragile, I wonder. Strict and simple instructions I'm sure.

    Jason

    Tuesday, May 24, 2011 12:21 PM
  • Jason,

    The example files were sent.  Are you in receipt?  I have to step away (regular work) but will check back this evening.

     

     


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm
    Tuesday, May 24, 2011 12:36 PM
  • See the Boiler Zip add-in that you can down load from the following page of fellow MVP Graham Mayor's website:

    http://www.gmayor.com/downloads.htm


    Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "Jason Parras" wrote in message news:3c92359e-5905-433d-b0d8-318d2fddf31a@communitybridge.codeplex.com...

    Greg,


    I greatly appreciate your help! If you could make me a sample I could easily add stuff to then you would have diplomatic immunity.

    Jason


    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    Saturday, May 28, 2011 5:44 AM