Remove space in outline

gailb
3StarLounger
Posts: 254
Joined: 09 May 2020, 14:00

Remove space in outline

Post by gailb »

I downloaded an outline from the web but get these spaces before and after the number reference. I turn on the paragraph marks and the space is not a space. I tried to find and replace a non-breaking space and it's not that either. I can manually delete the two spaces, but how can I do this with VBA?

1. Introduction ( 1:1⁠–⁠9 )

With the about example, there is a space before the 1 and a space after the 9

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Remove space in outline

Post by HansV »

Try the following:

- Select an opening parenthesis and the space after it.
- Copy it (Ctrl+C)
- Press Ctrl+H to activate the Replace dialog.
- Clear the 'Find what' box, then paste (Ctrl+V)
- Clear the 'Replace with' box.
- Click 'Replace All'.

Repeat, this time copying a closing parenthesis and the space before it.
Best wishes,
Hans

gailb
3StarLounger
Posts: 254
Joined: 09 May 2020, 14:00

Re: Remove space in outline

Post by gailb »

Thanks Hans, that worked.

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Remove space in outline

Post by HansV »

The advantage of this method is that you don't have to know what the actual character is. By copying it into the 'Find what' box, Word takes care of it for you.
Best wishes,
Hans