View Single Post
 
Old 10-06-2015, 05:40 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you need to add the dropdown programmatically, you could use a separate macro, coded along the lines of:
Code:
Sub CreateDropDown()
Application.ScreenUpdating = False
Dim Prot As Variant, Rng As Range, FmFld As FormField
Const Pwd As String = ""
With ActiveDocument
  Prot = .ProtectionType
  If .ProtectionType <> wdNoProtection Then
    Prot = .ProtectionType
    .Unprotect Password:=Pwd
  End If
  Set Rng = ???
  Rng.InsertBefore Chr(147)
  Rng.Collapse wdCollapseEnd
  Set FmFld = .FormFields.Add(Range:=Rng, Type:=wdFieldFormDropDown)
   With FmFld
    .Name = "RecordsDD"
    .EntryMacro = ""
    .ExitMacro = "ConditionalContent"
    .Enabled = True
    With .DropDown.ListEntries
      .Add Name:="Record Collection"
      .Add Name:="U.S. Public Records Index"
      .Add Name:="United States Public Records 1970-2010"
    End With
  End With
  .Protect Type:=Prot, Password:=Pwd, NoReset:=True
End With
Set FmFld = Nothing: Set Rng = Nothing
Application.ScreenUpdating = True
End Sub
As you'll see, I've basically left the insertion range undefined; you'll have to replace the ??? with an appropriate definition.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote