> In Word 2000, I have a document that lists a series of ID numbers, titles,
> and other information, each in a five-paragraph set. Each paragraph within
[quoted text clipped - 5 lines]
> 2. Remove the ID paragraph.
> 3. Repeat for the entire document.
Play with this to get you started:
Dim i As Long
With ActiveDocument
For i = Paragraphs.Count To 1 Step -1
If .Paragraphs(i).Style = "Web ID" Then
.Bookmarks.Add "ID_" & Left(.Paragraphs(i).Range.Text, _
Len(.Paragraphs(i).Range.Text) - 1), .Paragraphs(i + 1).Range
.Paragraphs(i).Range.Delete
End If
Next
End With
A few words regarding bookmarks:
The first character cannot be a number (This is why I include the "ID_"
string).
The length limit is 40 characters.
There cannot be any spaces in the bookmark names.
Names must be unique, if they are not, the new one will be created, but the
old one with the same name will be automatically removed.
So, depending on the nature of the content of your ID string of text, you
may need to tweak the code...
Jerry - 17 May 2008 18:52 GMT
Perfect; thanks!
> > In Word 2000, I have a document that lists a series of ID numbers, titles,
> > and other information, each in a five-paragraph set. Each paragraph within
[quoted text clipped - 30 lines]
> So, depending on the nature of the content of your ID string of text, you
> may need to tweak the code...