Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 06-17-2021, 01:34 AM
Shelley Lou Shelley Lou is offline VBA quote mark to insert after square bracket Windows 10 VBA quote mark to insert after square bracket Office 2016
Expert
VBA quote mark to insert after square bracket
 
Join Date: Dec 2020
Posts: 259
Shelley Lou is on a distinguished road
Default

I have identified that this is the part of the code that inserts bold quotes around the main bold definition text at the beginning. Can someone help me with the code so that if the definition starts with a square bracket that the quote inserts after the square bracket and not before (see doc at beginning of post). I've tried Graham's search and replace but it doesn't seem to work. Thanks

Code:
With orng.Find
    .Text = ""
    .Replacement.Text = "^034^&^034"
    .Font.Bold = True
    .Format = True
    .MatchWildcards = True
    While .Execute
      If Not InStr(orng.Text, Chr(13)) Then
        While orng.Characters.Last = Chr(32)
          orng.Characters.Last.Font.Bold = False
          orng.End = orng.End - 1
        Wend
        orng.Text = Chr(34) & orng.Text & Chr(34)
        If orng.Characters.First.Previous = Chr(13) Then
          orng.Collapse wdCollapseEnd
          orng.Font.Bold = False
          orng.Characters.Last = vbTab
        Else
          orng.Collapse wdCollapseEnd
        End If
      End If
    Wend
  End With
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Block Quote into Numbered List krose4088 Word 4 12-10-2020 02:29 PM
VBA quote mark to insert after square bracket Delete blank paragraph below bold, end square bracket Dave T Word VBA 2 04-28-2019 11:00 PM
VBA quote mark to insert after square bracket Remove repeated number after square bracket jeffreybrown Word VBA 8 12-04-2018 06:01 PM
Word 2010 - Remove square-bracket encased string in large document IntestinalWorm Word 1 06-20-2017 01:14 AM
VBA quote mark to insert after square bracket Insert caption to graphic with square text wrapping nothing_kills Drawing and Graphics 7 01-20-2014 10:57 PM

Other Forums: Access Forums

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