Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 08-28-2014, 08:26 AM
lucky16 lucky16 is offline Conditional Outputs from Content Control Dropowns Windows 7 32bit Conditional Outputs from Content Control Dropowns Office 2007
Novice
Conditional Outputs from Content Control Dropowns
 
Join Date: Jan 2014
Posts: 21
lucky16 is on a distinguished road
Default

In properties of content control, the lock option was already unchecked. Still getting this run time error.
I've attached the word document and code below. Can you please have a look.
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
  If .Title = "Name1" Then
  For i = 1 To .DropdownListEntries.Count
    If .DropdownListEntries(i).Text = .Range.Text Then
      StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
      Exit For
    End If
  Next
  ActiveDocument.SelectContentControlsByTitle("Details1").Item(1).Range.Text = StrDetails
  End If
  
  If .Title = "Name2" Then
  For i = 1 To .DropdownListEntries.Count
    If .DropdownListEntries(i).Text = .Range.Text Then
      StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
      Exit For
    End If
  Next
  ActiveDocument.SelectContentControlsByTitle("Details2").Item(1).Range.Text = StrDetails
  End If
  
  End With
End Sub
Thanks
Laxman
Attached Files
File Type: docx Doc1.docx (21.2 KB, 14 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Outputs from Content Control Dropowns Clicking the selected Content Control checkbox returns wrong control in vba event DougsGraphics Word VBA 2 06-24-2015 07:31 AM
Conditional Outputs from Content Control Dropowns Assign a value to a Content Control SuzeG Word VBA 10 12-08-2013 08:04 AM
Conditional Outputs from Content Control Dropowns Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM
Conditional Outputs from Content Control Dropowns Content control problem Anja Word 2 10-16-2013 09:56 AM
Retrieving content control value jillapass Word VBA 4 05-24-2012 05:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:12 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