View Single Post
  #18   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to search for (and select) paragraphs with certain format parameters

Even working with vba seems problematical, as the levels associated with the
bullets do not seem to be accessible. However the following macro *may*
help. Put the cursor in one of the bulleted paragraphs in question and all
paragraphs that have the same indent will be formatted with the heading
style number ( 1 - 9) entered into the dialog. The original bullet will be
removed and will only be re-applied if the chosen heading style is bulleted.
The only snag that immediately comes to mind is that there may be unbulleted
paragraphs with the same left indent

Sub AddHeadingStyle()
Dim iIndent As Long
Dim iStyle As String
Dim oPara As Paragraph
Start:
On Error Resume Next
iStyle = InputBox("Enter Heading Style number 1-9")
If iStyle = "" Then Exit Sub
iIndent = Selection.Paragraphs(1).LeftIndent
For Each oPara In ActiveDocument.Paragraphs
If oPara.LeftIndent = iIndent Then
oPara.Style = "Heading " & iStyle
End If
Next oPara
End Sub

http://www.gmayor.com/installing_macro.htm
I would recommend testing it on a copy of the document.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Stefan Blom" wrote in message
...
My point was that, as far as I know, there is no way in the user interface
to do what the OP is asking for. Maybe it can be automated with VBA.

--
Stefan Blom
Microsoft Word MVP
(Message posted via NNTP)



"Suzanne S. Barnhill" wrote in message
...
The problem here is that the multilevel bullets have already been
applied,
presumably to Normal style, and the paragraphs have been progressively
indented to create three different levels. There should be some way to
distinguish among these three levels (which are clearly displayed
differently)
in order to search for paragraphs at a specific level and apply a
specific
style.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Stefan Blom" wrote in message
...
Paul,

You can set up multilevel/outline bullets via that same dialog box. Just
choose a bullet for "Number style." There are some predefined bullets
already
in the drop down box, but if you don't see what you want, click "New
Bullet"
to select the desired bullet character.

In this case I'd start with the Modify Style dialog box for Heading 1,
setting up the desired bullet format for each levels, making sure to
associate each level with the corresponding heading style.

However, I don't know of a way to automate the application of styles to
text;
that, I'm afraid, will be a manual task.

--
Stefan Blom
Microsoft Word MVP
(Message posted via NNTP)



"Paul" wrote in message
...
Stefan,

The text consists of multilevel bullets, not numbered list items. I
am trying to find and select all bullets of a specific level so that I
can apply a Heading style to them. Does your suggestion still apply?

On Apr 30, 3:06 pm, "Stefan Blom"
wrote:
In Word 97-2003, you must always use the Customize Outline Numbered
List
dialog
box when setting options for an outline-numbered list, yes.

Note that the recommended approach is to define your lists with a
unique
paragraph style attached to each level; you apply (and edit) number
formatting
via the Modify Style dialog box for the top-level style.
Seehttp://www.shaunakelly.com/word/numbering/OutlineNumbering.html.

If you are modifying a list that is not associated with styles, place
the
insertion point in the first level 1 item before clicking Format |
Bullets
and
Numbering.

"Paul" wrote
I put the cursor in one of the pasted bullet paragraphs. I invoked
Format-BulletsAndNumbering-Customize. All the numerical positioning
parameters are zero:

* BulletPosition-IndentAt
* TextPosition-TabSpaceAfter
* TextPosition-IndentAt

That's odd, I thought. So invoked the Reveal Formatting pane from the
Styles and Formatting pane, and sure enough, the Bullets and Numbering
section showed the above three parameters to be zero. According to
Reveal Formatting, the *only* difference between bullets of different
levels is in the Left Indent, in the Paragraph parameters of the
Reveal Formatting pane.

Suzanne, is looking at the Bullets and Numbering pane as described
above what you had in mind?

On Apr 30, 1:36 pm, "Suzanne S. Barnhill" wrote:
In this case the indent is set in the Bullets (Numbering) dialog
rather
than
Paragraph, so perhaps you should try that instead.

"Paul" wrote:
I posted this in another thread, but the thread title dealt with a
larger contextual problem, so it may go unnoticed.

In Word 2003, I want to search for, and select, all paragraphs that
conform to a list of attributes e.g. left indent of 0.53", hanging
indent at 0.26", etc.. From the "Find and Replace" panel, I chose
Format-Paragraph, and set the left indent to 0.53", etc.. Word did
not find any of the paragraphs conforming to these attributes, even
though they exist. Is there a way to search for (and select)
paragraphs based on formatting parameters?

I am using Word 2003.