Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #18  
Old 01-15-2011, 01:17 PM
macropod's Avatar
macropod macropod is offline Save Selection Windows 7 32bit Save Selection Office 2000
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

Hi Brock,

Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim strTmp As String, oCel As Cell, rngTmp As Range, i As Integer, j As Integer
With ActiveDocument
  If .Sections.Count > 3 Then
    For i = 4 To .Sections.Count
      With .Sections(i).Range
        If .ContentControls.Count > 0 Then
          strTmp = .ContentControls(1).Range.Text
          For j = 2 To .ContentControls.Count
            strTmp = strTmp & ":" & .ContentControls(i).Range.Text
            If j > 2 Then Exit For
          Next j
          For Each oCel In .Tables(1).Range.Cells
            Set rngTmp = oCel.Range
            rngTmp.End = rngTmp.End - 1
            If rngTmp.Text = vbNullString Then
              .Indexes.MarkEntry Range:=rngTmp, Entry:=strTmp, _
                CrossReference:="", CrossReferenceAutoText:="", _
                BookmarkName:="", Bold:=False, Italic:=False
              Exit For
            End If
          Next oCel
        End If
      End With
    Next j
  End If
End With
Set rngTmp = Nothing
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox updating from combobox selection paxile2k Word VBA 0 10-26-2010 02:30 PM
Document selection procedure kennethc Word 0 09-15-2010 02:56 PM
The modification is not allowed because selection is locked aligahk06 Word 0 09-06-2010 06:28 AM
Automatic find replace after selection in dropdown vsempoux Word 0 10-28-2009 08:45 AM
Highlighted Selection on Action Settings mos7sad PowerPoint 0 10-12-2009 07:48 AM

Other Forums: Access Forums

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