The following VBA code can add a horizontal line in front of the line where # sub is located
The following code sometimes works unsteadily, why?
________________________________________________________________________________
Word.Find f=app.Selection.Find
f.ClearFormatting
f.Text="#sub"
rep
if(!f.Execute)
break
app.Selection.ParagraphFormat.Borders.Item(wdBorderTop).LineStyle = wdLineStyleSingle
The following code sometimes works unsteadily, why?
________________________________________________________________________________
Word.Find f=app.Selection.Find
f.ClearFormatting
f.Text="#sub"
rep
if(!f.Execute)
break
app.Selection.ParagraphFormat.Borders.Item(wdBorderTop).LineStyle = wdLineStyleSingle