Bonjour,
Dans son message, Jason L écrivait :
In this message, Jason L wrote:
|| Hey, I have a somewhat complicated merge request. The user needs a
section
|| break after two words (Recommendations and Discussion - both bolded in
TNR,
|| 11 pt) in a document. These words may appear once or several times, but
|| there needs to be a section break after each one. I was trying to create
a
|| macro, but I'm not sure what the code or character is for section break.
I
|| know the find character is ^b, but that doesn't work for replace.
||
|| So, in a nutshell I need a way to find the two words and add a section
break
|| after each one. I thought about a bookmark after each one, and then
finding
|| the bookmark, but that sounds a tad too complicatd for something that
seems
|| so minor.
||
This should get you started:
'_______________________________________
Const LookFor As String = "Recommendations and Discussion"
With ActiveDocument.Content.Find
.ClearFormatting
.Text = LookFor
With .Font
.Name = "Times New Roman"
.Bold = True
.Size = 11
End With
Do While .Execute
With .Parent
.Collapse wdCollapseEnd
.InsertBreak wdSectionBreakContinuous
.Collapse wdCollapseEnd
End With
Loop
End With
'_______________________________________
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site: http://www.word.mvps.org