Share via

Copying Drop Down Menus

Anonymous
2015-07-08T19:20:57+00:00

Hi,

I'm new here.

I have a template that I use daily. It is formatted (bold/italic/sizes/bullets), and has both fill in text fields and drop down menus.

Once I finish filling out the template, I copy the entire thing from Word and paste it into another program.

I've noticed, though, that the drop down choices are actually bringing over the full menu and not just the text that has been selected. Because of this the text that I'm pasting is very large in terms of data (since the drop downs have alot of options in them).

Pasting as "text only" won't work because all of my formatting throughout will be lost.

Is there a way to collect only the text from my drop down choice, as opposed to the entire thing?

Thanks!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Jay Freedman 207.7K Reputation points Volunteer Moderator
2015-07-08T22:09:13+00:00

I'll assume that you're working with legacy form fields in a protected template, rather than with content controls. If that's not the case, a similar solution is possible.

The manual method goes like this: After an entry in each dropdown is selected but before copying, first turn off the forms protection; then click in each dropdown field and press Ctrl+Shift+F9 to "unlink" it. That removes the form field, including all the unused data in its list, and leaves just the text of the selected choice.

The following macro does the equivalent actions for all the dropdown form fields in the document. (See http://www.gmayor.com/installing_macro.htm if needed.) As written, it copies the resulting document to the clipboard, but leaves the modified and unprotected document on the screen. If you wish, the macro can be expanded a bit to save the document before unprotecting it, and closing the document without saving after the copying, so you'd have the unmodified form on disk.

Sub CopyWithoutDropdowns()

    ' Convert all dropdown form fields in the document

    ' to just the selected text. Then copy the whole

    ' document to the clipboard for pasting elsewhere.

    Dim pwd As String

    Dim fld As FormField

    Dim counter As Long

    pwd = "" ' <== If a password is applied to the

             '     forms protection, insert it

             '     between the quotes

    With ActiveDocument

        If .ProtectionType <> wdNoProtection Then

            .Unprotect Password:=pwd

        End If

        For counter = .FormFields.Count To 1 Step -1

            Set fld = .FormFields(counter)

            If fld.Type = wdFieldFormDropDown Then

                fld.Range.Fields(1).Unlink

            End If

        Next counter

        .Content.Copy

    End With

End Sub

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful