How can I use .find for a bullet style property?

I

Ian

originally posted on vba but think this might be more
similar

I have tried help to solve this but now i am stuck.
I want to be able to scan a large document which has
tables.
In some of the table's cells are paragraphs I want to
select. These paragraphs have a bullet at the start and
other various properties such as font etc.

I am only searching for the bulletted ones. hence not
bothered by fonts, bold, italics etc.

I went to help learnt to how make a style and edit it from
the format>style... menu.

but it still wont locate the paragraphs, just the one I
made the style from...
It seems to have changed the properties of the paragraph
when I gave it a style name.

I recorded my attempt and tried to edit it from VBA but
just asking to search the style with

Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("ABullet")
Selection.Find.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
and further removed all in the with..end with but no luck.

Once again im just trying to locate bullet paragraphs from
VBA hope you can help.
Ian
..
 
I

ian

thanks Helmut this works...
If Selection.Range.ListFormat.ListType = 0 Then _
MsgBox "No Bullet" Else MsgBox "Bulleted"
Selection.MoveDown Unit:=wdParagraph, Count:=1
but now, this problem...

when i MoveDown in the table it goes to the cell
on the right then off the table row, before the next lower
cell.

how do i sellect the cell and movedown or movedown a cell?
i've tried Selection.MoveDown unit=wdcell, but it didn't
move???
i've tried
Selection.SelectCell
Selection.MoveDown
but whilst works sometimes jumps cells other times???
usually jumps the cell i'm after
(a large table cell with several bulleted paragraphs)
BUT only/usually on the first run???How unpredictable??

When i get the code working it will run a basic
form that will .find a title eg"WMS3.4" in a table
move down 4 cells to the bulleted paragraphs and
place them in a list box for selection.
I've got the form running with list boxes
I've got the .find working for the title
As the tables are two columns and info is in both sides
eg.

________________________
| WMS2.4 | WMS3.4 |
------------------------
|..........|...........|
|..........|...........|
|..........|...........|
_______________________
| bulleted | bulleted |
|paragraphs|paragraphs |
------------------------
I need to move down under WMS3.4?
some of the other cells have paragraphs in them.

I'm only want to "move down 4 cells to the bulleted
paragraphs"

Hope you can help, and that it is not too busy for you.
Thanks again Ian
PS just thought might try count=3???But simple code may be
better?
 
W

Word Heretic

G'day "Ian" <[email protected]>,

You need to test each para in your target ranges for a .listformat of
type bullet.


Ian said:
originally posted on vba but think this might be more
similar

I have tried help to solve this but now i am stuck.
I want to be able to scan a large document which has
tables.
In some of the table's cells are paragraphs I want to
select. These paragraphs have a bullet at the start and
other various properties such as font etc.

I am only searching for the bulletted ones. hence not
bothered by fonts, bold, italics etc.

I went to help learnt to how make a style and edit it from
the format>style... menu.

but it still wont locate the paragraphs, just the one I
made the style from...
It seems to have changed the properties of the paragraph
when I gave it a style name.

I recorded my attempt and tried to edit it from VBA but
just asking to search the style with

Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("ABullet")
Selection.Find.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
and further removed all in the with..end with but no luck.

Once again im just trying to locate bullet paragraphs from
VBA hope you can help.
Ian
.

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top