Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2018, 05:55 PM
jeffreybrown jeffreybrown is offline One content control updating another Windows Vista One content control updating another Office 2007
Expert
One content control updating another
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default


Thanks Paul and sorry about posting in the wrong forum.

Since I have many different content controls in this one doc, I need to update the entire doc no matter what control is updated. I added the part in blue to the event below, but after the event fires, instead of the whole doc being selected, can I select maybe the cell below? The content control is in a table. What about if the user doesn't tab, but instead they just select some other cell?

Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
  If .Title = "MyCC_MAF" 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.ContentControls(2).Range.Text = StrDetails
  End If
End With
With Selection
    .WholeStory
    .Fields.Update
End With
End Sub
Reply With Quote
  #2  
Old 09-16-2018, 06:04 PM
macropod's Avatar
macropod macropod is offline One content control updating another Windows 7 64bit One content control updating another 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 jeffreybrown View Post
Since I have many different content controls in this one doc, I need to update the entire doc no matter what control is updated.
That's a bit ambiguous - what updates to the whole document are necessitated by updating a single content control?
Quote:
Originally Posted by jeffreybrown View Post
I added the part in blue to the event below, but after the event fires, instead of the whole doc being selected, can I select maybe the cell below? The content control is in a table. What about if the user doesn't tab, but instead they just select some other cell?
The code you added is for updating fields, not content controls. Whether one exits a content control by tabbing or via the mouse is inconsequential.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Control content deleted when re-uploading to SharePoint Peterson Word 5 06-27-2018 08:13 PM
One content control updating another One Content Control Checkbox checks another Content Control Checkbox DEsh Word VBA 2 10-06-2017 08:23 PM
One content control updating another Clicking the selected Content Control checkbox returns wrong control in vba event DougsGraphics Word VBA 2 06-24-2015 07:31 AM
One content control updating another Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM
One content control updating another Automatically Updating Content in Text dumbass0101 Word 4 10-11-2012 07:50 AM

Other Forums: Access Forums

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