Thread: [Solved] Word 2007 - Drop Box Issue
View Single Post
 
Old 09-17-2012, 08:36 AM
skusekd skusekd is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Sep 2012
Posts: 5
skusekd is on a distinguished road
Default Macro

Thank you again!

I see what you're saying about the organization of the form, without separate headings it would be a little chaotic. So, back to the simple more organized idea

Problem though, I'm getting this error:

"Complie error: Invalid or unqualified reference" referring to the .Value in the "if .value = 11 Then"

Here's the macro I pasted along with my (minor) changes:

Code:
Sub FreeText()
Dim StrNew As String
With ActiveDocument.FormFields("NAME").DropDown
  If .Value = 11 Then
  StrNew = Trim(InputBox("Input your text", "Free text input"))
  If StrNew = vbNullString Then Exit Sub
    .ListEntries(11).Delete
    .ListEntries.Add StrNew
    .Value = 11
  End If
End With
End Sub

Last edited by macropod; 09-17-2012 at 08:10 PM. Reason: Added code tags & formatting
Reply With Quote