![]() |
|
#1
|
||||
|
||||
![]()
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] |
#2
|
|||
|
|||
![]()
All of these citations I need to have an exit macro on the last form field to unlink the fields. Since the way you have shown me to write this code is different, do you have a spot where I can insert into the code? Learning this way is painful-
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Replace & case | Jennifer Murphy | Word | 1 | 02-11-2013 03:26 AM |
Question about Case statement | Jennifer Murphy | Word VBA | 1 | 01-05-2013 02:30 PM |
Case Sensitive (contains) Selection | apolloman | Excel | 2 | 07-12-2011 04:50 AM |
![]() |
davers | Word | 1 | 04-30-2009 12:41 PM |
Upper to lower case | jd | Excel | 1 | 04-28-2006 07:40 AM |