Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 12-10-2020, 10:30 PM
gmayor's Avatar
gmayor gmayor is offline Help with Definitions Macro Windows 10 Help with Definitions Macro 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

Your macro does not convert the document to match the result example. They most obvious difference is the example doesn't use tabs whereas the macro inserts them. To get what you wanted and based solely on the provided examples, you need something like.

Code:
Sub DPU_convertdefinitions()
Dim vFindText As Variant
Dim vReplaceText As Variant
Dim i As Integer
    vFindText = Array(Chr(34), Chr(9), Chr(32) & Chr(45), Chr(32) & Chr(44), Chr(32) & Chr(41), Chr(32) & Chr(38))
    vReplaceText = Array("", " ", Chr(45), Chr(44), Chr(41), Chr(38))
    For i = 0 To UBound(vFindText)
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find
            .Text = vFindText(i)
            .Replacement.Text = vReplaceText(i)
            .Forward = True
            .Wrap = wdFindContinue
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
            .Execute Replace:=wdReplaceAll
        End With
        DoEvents
    Next i
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Definitions Macro Macro to highlight unused definitions and undefined terms Johnmajor Word VBA 20 02-18-2020 06:59 PM
Spell check macro within macro button field doesn't work in one document samuelle Word VBA 0 07-20-2016 02:27 AM
Help with Definitions Macro Word Dictionary for Word 2007 - Molecular Biology definitions & videos philpense Word 1 02-23-2015 04:34 PM
Help with Definitions Macro How to update fields in all header definitions ChrisBrewster Word VBA 2 02-10-2014 10:33 AM
Problem: object library invalid or contains references to object definitions aligahk06 Office 0 08-19-2010 12:29 PM

Other Forums: Access Forums

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