Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2013, 02:31 PM
macropod's Avatar
macropod macropod is offline Content control merge values? Windows 7 32bit Content control merge values? 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

Assuming the dropdown controls you mentioned are the only ones in the document and your text content control has the title 'Output', you could use code in the document's 'This Document' module like:


Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim StrOutput As String, CtrlID As String
If ContentControl.Type <> wdContentControlDropdownList Then Exit Sub
For Each ContentControl In ContentControls
  If ContentControl.Type = wdContentControlDropdownList Then
    If ContentControl.Range.Text <> ContentControl.PlaceholderText Then
      StrOutput = StrOutput & ContentControl.Range.Text & "+"
    Else
      StrOutput = StrOutput & "N/A" & "+"
    End If
  End If
  If ContentControl.Title = "Output" Then CtrlID = ContentControl.ID
Next
StrOutput = Left(StrOutput, Len(StrOutput) - 1)
ContentControls(CtrlID).Range.Text = StrOutput
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Content control merge values? Move to next content control cksm4 Word VBA 13 07-02-2019 07:48 PM
Content control merge values? Hierarchical content control ntjson Word VBA 1 04-04-2013 12:07 AM
Content control merge values? Content control titles jillapass Word VBA 3 05-29-2012 06:11 AM
Retrieving content control value jillapass Word VBA 4 05-24-2012 05:07 AM
Calendar control accepts other values JeJ Word 0 03-02-2011 03:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:11 PM.


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