View Single Post
 
Old 10-14-2015, 04:28 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

Quote:
Originally Posted by brent chadwick View Post
So I messed with a little bit
No kidding!
Code:
Const BmkCCBmk As String = "CCBookmark" 'bookmark name
Const Pwd As String = "" 'Filling in Forms password
 
Sub PublicRecordsCombinedMacro()
'PublicRecordsCombinedMacro Macro
Application.ScreenUpdating = False
Dim Prot As Variant, Rng As Range, FmFld As FormField
With ActiveDocument
  Prot = .ProtectionType
  If .ProtectionType <> wdNoProtection Then
    Prot = .ProtectionType
    .Unprotect
   End If
  Set Rng = Selection.Range
  Rng.Collapse wdCollapseStart
  'Dropdown Menu for Record Collection
  Set FmFld = .FormFields.Add(Range:=Rng, Type:=wdFieldFormDropDown)
  With FmFld
    .Name = "RecordsDD"
    .EntryMacro = ""
    .ExitMacro = "CondtionalContent"
    .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
  With Rng
    .End = FmFld.Range.End
    .InsertBefore Chr(210)
    .InsertAfter ","
    .Collapse wdCollapseEnd
  End With
  With Rng
    .End = FmFld.Range.End
    .Collapse wdCollapseEnd
  End With
  .Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=Pwd
End With
Set FmFld = Nothing: Set Rng = Nothing
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote