Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Printing dropdown lists (W97, WinNT4)

    Does anyone know of a way to print the contents of a dropdown list, please?

    I have a form with quite a few on it, several of which use the maximum 25 entries, and I need to get a copy of the contents.

    Any help would be gratefully appreciated!
    Beryl M


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing dropdown lists (W97, WinNT4)

    The following macro expects a form document to be active. It will create a new document and list the entries of all dropdown form fields in the original document. You can adapt it to your needs and improve it if you like (it would be nicer to write the results to a table, for instance):

    Sub ListDropdownEntries()
    Dim ff As FormField
    Dim i As Integer
    Dim doc1 As Document
    Dim doc2 As Document
    Set doc1 = ActiveDocument
    Set doc2 = Documents.Add
    For Each ff In doc1.FormFields
    If ff.DropDown.Valid Then
    Selection.TypeText ff.Name
    Selection.TypeParagraph
    For i = 1 To ff.DropDown.ListEntries.Count
    Selection.TypeText "Entry " & i & ": " & ff.DropDown.ListEntries(i).Name
    Selection.TypeParagraph
    Next i
    Selection.TypeParagraph
    End If
    Next
    End Sub

    HTH,
    Hans

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Printing dropdown lists (W97, WinNT4)

    Wow! <img src=/S/starstruck.gif border=0 alt=starstruck width=15 height=15> Hans, you are a treasure! I can't believe how fast you came back with that - you must have already had it on hand, because if you wrote it that fast you must be a genius!

    Many thanks - I'm not too worried about making it pretty, it was just a way of getting a copy of the content I needed, and this was perfect for that.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Beryl M


  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing dropdown lists (W97, WinNT4)

    <hr>you must have already had it on hand, because if you wrote it that fast you must be a genius!<hr>
    The two aren't necessarily mutually exclusive. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> But I agree, Hans has posted some really neat macros.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •