boldit 
Author Message
 boldit

Why can delete it , and change to boldit, it doesn't work?

Sub Boldit
do
With Selection.Find
    .Text = "abc"
    .Format = False
    .Wrap = wdFindStop
    If .Execute Then
        ActiveDocument.Tables(1).Rows(1).Range.Select
 Selection.Font.Bold = wdToggle
    End If
End With
Loop While Selection.Find.Found
End Sub



Fri, 15 Jul 2005 10:01:41 GMT  
 boldit

Hi ldh,

You might want to try the following:

With Selection.Find
    .Text = "abc"
    .Format = False
    .Wrap = wdFindStop
    Do While .Execute
        ActiveDocument.Tables(1).Rows(1).Range.Font.Bold = wdToggle
    Loop
End With

Each time you select the row, you might be placing the cursor before the
first occurence of "abc" and therefore creating an infinite loop.

HTH


Quote:
> Why can delete it , and change to boldit, it doesn't work?

> Sub Boldit
> do
> With Selection.Find
>     .Text = "abc"
>     .Format = False
>     .Wrap = wdFindStop
>     If .Execute Then
>         ActiveDocument.Tables(1).Rows(1).Range.Select
>  Selection.Font.Bold = wdToggle
>     End If
> End With
> Loop While Selection.Find.Found
> End Sub



Sat, 16 Jul 2005 03:20:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 
 

 
Powered by phpBB® Forum Software