Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-06-2020, 10:48 PM
gmayor's Avatar
gmayor gmayor is offline Macro to Mark Text with Index Codes Windows 10 Macro to Mark Text with Index Codes Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You were almost right




Code:
Sub MarkIndexMacro()
Dim myRange As Range
    Set myRange = ActiveDocument.Range
    With myRange.Find
        .Text = ""
        .Font.ColorIndex = wdRed
        Do While .Execute
            ActiveDocument.Indexes.MarkEntry Range:=myRange, Entry:=myRange.Text
            myRange.Collapse 0
        Loop
    End With
    Set myRange = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #2  
Old 07-06-2020, 11:16 PM
MyUserName123 MyUserName123 is offline Macro to Mark Text with Index Codes Windows 10 Macro to Mark Text with Index Codes Office 2019
Novice
Macro to Mark Text with Index Codes
 
Join Date: Jul 2020
Posts: 10
MyUserName123 is on a distinguished road
Default

Hi, thanks for your response. I just tried the macro, and it seems to give me an infinite loop, with the XE codes repeating one right after another. I've experimented with modifying the code a few different ways, but I can't get it to stop looping. It also seems to put in a character that looks like a question mark in a box. I tried to copy and paste it here, but I can't.

Last edited by MyUserName123; 07-06-2020 at 11:35 PM. Reason: Edited to add more information.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Mark Text with Index Codes Macro for mark index entry for every word in a document? Jay Jay Word VBA 5 08-13-2015 03:44 PM
Hyperlinking from the Index to the Origin Mark Phil H Word 2 08-30-2013 04:03 AM
Index Addition Leaves Hidden Codes On SQLUSA Word 3 07-23-2012 02:58 AM
Options of Index Mark Entry smaria Word 1 04-22-2010 05:48 AM
Macro to mark non-coloured/non-highlighted text as hidden PeterB Word 0 10-28-2009 07:54 AM

Other Forums: Access Forums

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