#1
|
|||
|
|||
Getting rid of Non-breaking space
I have a problem which I am battling to solve. I am wondering if someone has done something similar:
I have several documents which contain strings such as: 1. Word$n:m (n and m being one, two or three digit numbers) 2. Word$n (as above) 3. x$Word$n:m (x = 1, 2 or 3) 4. x$Word$n (x = 1, 2 or 3) Word being any word appearing in an array of words. The words are case sensitive. $ = a non-breaking space As each occurrence is found I need to replace the non-breaking space with a normal space. Thank you in advance for any assistance. |
#2
|
|||
|
|||
If you use a space in the find box, it should find the non-breaking space. Replace it with a space character and you should have accomplished what you want.
Is there a reason this is posted in the vba forum rather than the general Word forum? If not, I can move it there. |
#3
|
|||
|
|||
Many replaces to do
Quote:
The reason why I put it here is that there are some 130 different possibilities of the words, so I was hoping to do it with VBA, rather than a word at a time with a find/replace. |
#4
|
||||
|
||||
You could, of course use a wildcard Find/Replace, where:
Find = ([A-Z][a-z]@)^s([0-9]) Replace = \1 \2 This would leave the non-breaking spaces before your 'Word' intact. If you're wedded to removing those, too, do a second wildcard Find/Replace, where: Find = ([0-9])^s([A-Z][a-z]@ [0-9]) Replace = \1 \2
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
non-breaking-space, replace, vba |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Non-breakable space to have same width as usual space | dum | Word | 5 | 09-14-2020 03:49 AM |
autocorrect double space to single space | frankjake | Word | 8 | 09-21-2018 05:44 PM |
In 2010 document set for no space between paragraphs, but getting large space. | normancamp | Word | 10 | 12-25-2017 04:54 PM |
Autocorrect numbers followed by any string to have non-breaking space | seanspotatobusiness | Word | 8 | 03-09-2017 05:09 AM |
Non-breaking space and similar characters | gpr | Word | 2 | 07-10-2015 06:44 AM |