![]() |
|
#1
|
|||
|
|||
![]() I have Word 2007 and I am using Drop-Down lists. When I choose some item and try to change its value program says: "This modification is not allowed because the selection is locked". I want to have an option to either choose value from drop-down list or write the value manually. How Drop-Down List can be unlocked? |
#2
|
||||
|
||||
![]()
Hi Ikks,
Dropdown formfields don’t support text entry. To provide that facility, you could provide an option in the dropdown for 'free text' and use an on-exit macro with an Inputbox to insert the user’s 'free text' into the dropdown. For example, suppose you have a dropdown with 5 items, the last of which offers free text entry (e.g. an 'Other' option). Adding the following on-exit macro to the formfield will provide that: Code:
Sub FreeText() Dim StrNew As String, i As Long With Selection.FormFields(1).DropDown i = .ListEntries.Count If .Value = i Then StrNew = Trim(InputBox("Input your text", "Data Entry", .ListEntries(i).Name)) If StrNew = vbNullString Then Exit Sub .ListEntries(i).Delete .ListEntries.Add StrNew .Value = i End If End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Thanks, it works now. I was wondering is it possible to pick values in Drop-Down Form Fields without protecting the whole document? In this document it is essential that all elements in the document can be edited. It is complicated to protect/unprotect form just in order to use Drop-Down Lists.
|
#4
|
||||
|
||||
![]()
Hi Ikks,
If you put Section breaks either side of the dropdown, you can protect only the dropdown's Section and the rest of the document can be edited. Do note, though, that some editing restrictions will remain in the other parts of the document.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
Thank you very much macropod! Works great now!
|
![]() |
Tags |
drop-down list unlock |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
click4akshay | Excel | 2 | 04-28-2011 01:51 PM |
Adding a country drop-down list | iyavor | Word | 0 | 10-27-2010 03:51 AM |
Create Drop Down List Box | hbradshaw | Word VBA | 0 | 09-27-2010 06:24 AM |
Drop Down List and Functions (Linking) | sten | Excel | 0 | 03-17-2010 03:03 PM |
Long List for drop down box | DLo99 | Word | 0 | 02-28-2010 08:07 AM |