|
|
|
date: Tue, 4 Mar 2008 04:44:44 -0800 (PST),
group: microsoft.public.word.vba.beginners
back
Re: How to find and delete a Heading with subtext?
On 4 Mrz., 17:15, Helmut Weber wrote:
> Hi,
>
> try this one:
>
> Sub Test65523()
> Dim rDcm As Range
> Set rDcm = ActiveDocument.Range
> With rDcm.Find
> .Style = "Heading 3"
> While .Execute
> If InStr(rDcm.Text, "TEST") > 0 Then
> rDcm.Select
> Selection.Bookmarks("\headinglevel").Range.Delete
> End If
> Wend
> End With
> End Sub
>
> which works here and now in case,
> there is no further heading that heading 3,
> means no heading 4.
>
> --
>
> Greetings from Bavaria, Germany
>
> Helmut Weber, MVP WordVBA
>
> Vista Small Business, Office XP
Thank you very much, Helmut. The code works as expected.
Greetings from Stuttgart, Germany
date: Wed, 5 Mar 2008 00:45:41 -0800 (PST)
author: unknown
|
|