![]() |
|
|
|
#1
|
|||
|
|||
|
The biggest reason is that I'd need to refactor a ton of code to make it work that way, and do so in a way inconsistent with the rest of my code. Normally I'd just do that, but in context of the whole project it's a lot more work than it sounds like.
My hope is that there's a simple flag I can use for "Don't delete adjacent spaces" - I think I've seen info about how to set that in Word option menus, but I can't find anything about doing it in VBA code. EDIT: Never mind, figured it out. If I replace VarRange.Delete with VarRange.Text = "" then it works fine. It seems like the adjacent space cleanup only applies when the .Delete procedure is run, and any other method of deleting it will leave the spaces. |
|
#2
|
||||
|
||||
|
Quote:
Code:
Selection.Find.Execute "<Replace Me>", , , False, , , True, wdFindStop, , "New Text", wdReplaceOne
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
|||
|
|||
|
Quote:
I posted a stripped-down sample sub in this thread, but don't confuse that with the actual program I'm working on. |
|
#4
|
||||
|
||||
|
You can, of course, pass the Find & Replace strings to that line as arguments... But, hey, if you don't want to improve your code, who am I to argue!
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I stop check boxes moving rows when text wraps in an adjacent cell? | PatrickYork | Excel | 2 | 04-04-2018 11:23 AM |
| Big Spaces/pages between text | tissueboxer | Word | 6 | 03-03-2018 07:52 AM |
| Vertical Text Alignment with Adjacent Columns | kdutrisac | Word Tables | 2 | 06-26-2017 12:38 PM |
| Deleting grid lines but keeping the axis lines | CoffeeNut | Excel | 0 | 04-01-2013 01:50 PM |
| Conditional Formatting Expiration Dates Based on Text in Adjacent Cell | Frogggg | Excel | 1 | 10-25-2011 08:44 PM |