Group: microsoft.public.word.vba.general
From: andreas
Date: Monday, March 03, 2008 5:19 AM
Subject: Re: Delete any leading (redundant) spaces after tab of built-in-heading styles

On 2 Mrz., 23:16, "Doug Robbins - Word MVP"
wrote:
> You can do this using Edit>Replace. =A0In the Find and Replace dialog, cli=
ck
> on the More button and then check the "Use wildcards" box and in the Find
> what control, enter
>
> (^t)[ ]{1,}
>
> and in the Replace with control, enter
>
> \1
>
> Then click on Replace All
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "andreas" wrote in message
>
> news:316cbe83-fed6-48b3-a5e6-00219fc76890@h11g2000prf.googlegroups.com...
>
>
>
> > Dear Experts,
> > I got a long word-file where the user has inserted spaces (1 to n)
> > after the tab of the built-in heading styles (featuring hanging
> > indents) and before the text of the headings. Example
>
> > 1.1Tab(HangingIndent)RedundantLeadingSpacesHeadingText
>
> > But it should be:
> > 1.1Tab(HangingIndent)HeadingText
>
> > So how can I programmatically (VBA) drop these redundant leading
> > spaces?
>
> > Help is much appreciated. Thank you very much in advance.
>
> > Regards, Andreas- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Doug,

thanks for your quick help. I am getting an error message, telling me
that this expression is not working (on the search and replace dialog
field). I altered the expression to
(^t) {1,} and replaced it with ^t . Now it works but it does not find
the tabs followed by spaces on the built-in headings (heading 1,
heading 2, heading 3). May be it cannot find tabs before the built-in
headings since the tab ist part of the underlying field of the
heading. I hope I made myself clear.

Regards, Andreas