Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2023, 07:01 AM
gmayor's Avatar
gmayor gmayor is offline Output at the end of the text of all links using VBA Windows 10 Output at the end of the text of all links using VBA Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,145
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

It might make more sense for the future to use automatic numbering so you won't have the problem with missed references, however
Code:
Sub Macro1()
Dim oRng As Range
Dim sText As String
    Selection.HomeKey wdStory
    Selection.Find.ClearFormatting
    With Selection.Find
        Do While .Execute(findText:="\[[0-9]{1,}\]", _
                          MatchWildcards:=True, _
                          Wrap:=wdFindStop, _
                          Forward:=True) = True
            Set oRng = Selection.Range
            sText = sText & oRng.Text & Chr(32)
        Loop
    End With
    ActiveDocument.Range.InsertAfter vbCr & sText
lbl_Exit:
    Exit Sub
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform to output specific text ~clover Word VBA 2 06-01-2019 07:04 AM
Output at the end of the text of all links using VBA Content Control Listbox output to text box possible? VGW Word VBA 2 07-05-2018 04:18 PM
Outlook Template: Trying to Output text and fields back2ict Outlook 0 07-03-2018 08:57 AM
How do I output text to a specific cell (x,y)? norwood Word VBA 2 01-31-2014 08:43 AM
Generating text output from PowerPoint picture/name slides bornslippy PowerPoint 2 12-05-2013 11:04 AM

Other Forums: Access Forums

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


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2026 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft