Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 03-15-2022, 02:14 PM
macropod's Avatar
macropod macropod is offline Dropdown list dependency and autofill Windows 10 Dropdown list dependency and autofill Office 2016
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

Oops! Add the following code the the document:
Code:
Private Sub Document_Open()
Dim CCtrl As ContentControl, i As Long
With ActiveDocument
  For Each CCtrl In .ContentControls
    With CCtrl
      If .Title = "Risiko" Then
        If .Type = wdContentControlRichText Then
          .LockContents = False
          .Type = wdContentControlDropdownList
          .DropdownListEntries.Add "Uakseptabel"
          .DropdownListEntries.Add "Akseptabel"
          .DropdownListEntries.Add "Middels"
          .Type = wdContentControlRichText
          .LockContents = True
        End If
      End If
    End With
  Next
  .Saved = True
End With
End Sub
or, if being run from a template, add all the code to that template, along with:
Code:
Private Sub Document_New()
Call Document_Open
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofill Dropdown Syed Rashid Word 1 06-22-2021 10:59 AM
Compose Email - Autofill List Style Change RoscoW88 Outlook 2 05-24-2021 06:44 PM
Dropdown list dependency and autofill Autofill a field based on drop down list selection lascough20 Word 2 09-21-2018 02:24 AM
Selection of a dropdown creates another dropdown wih the list krishnamurthy.ka2810 Word VBA 1 04-26-2018 11:44 PM
Dropdown list dependency and autofill Autofill a form which is contingent on a dropdown selection. biffle0764 Word 2 05-09-2012 12:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft