Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jamez1971uk - 27 Sep 2006 13:14 GMT
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 !!!!
Dave Lett - 27 Sep 2006 14:20 GMT
Hi,

Try running the routine without the line:

   Selection.Find.ParagraphFormat.Borders.Shadow = False

HTH,
Dave

>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
[quoted text clipped - 28 lines]
>
> Can anyone help me please !!!!
Jamez1971uk - 27 Sep 2006 14:47 GMT
Thanks Dave problem solved !!!

> Hi,
>
[quoted text clipped - 37 lines]
> >
> > Can anyone help me please !!!!

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.