View Single Post
 
Old 03-01-2019, 07:54 AM
Alsadius Alsadius is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Nov 2017
Posts: 25
Alsadius is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Why not just use a Find/Replace?
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.
Reply With Quote