Find.Selection does not change selection when the find criteria is found

J

Jamez1971uk

I have been creating a nice template which will control styles when
they are pasted into a document and any unrecognised style will be set
to normal.

I then wanted to offer the user a macro button which will jump down to
any text of style normal.

I expected this to work with just a normal Find.Selection statement -
however the cursor in the document does not move to the found
selection.

Sub Find_Unformatted()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Normal")
Selection.Find.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = "^?"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub

Can anyone help me please !!!!
 
D

Dave Lett

Hi,

Try running the routine without the line:

Selection.Find.ParagraphFormat.Borders.Shadow = False

HTH,
Dave
 
J

Jamez1971uk

Thanks Dave problem solved !!!


Dave said:
Hi,

Try running the routine without the line:

Selection.Find.ParagraphFormat.Borders.Shadow = False

HTH,
Dave
 

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