With the code in the link, and assuming you're using early binding, you'd replace:
Code:
Dim Sctn1 As Section, Sctn2 As Section
with code like:
Code:
Dim wdApp as New Word.Application, wdDoc as Word.Document
Dim Sctn1 As Word.Section, Sctn2 As Word.Section
You'd also replace:
Code:
With Selection
If .Sections.Count = 1 Then
MsgBox "Selection does not span a Section break", vbExclamation
Exit Sub
End If
with the document reference. For example:
Code:
Set wdDoc = wdApp.Documents.Add (template reference)
With wdDoc
and you'd replace:
Code:
Set Sctn1 = .Sections.First: Set Sctn2 = .Sections.Last
with code like:
Code:
Set Sctn1 = .Sections(x): Set Sctn2 = .Sections(y)
where 'x' is the # of the first Section to be deleted and 'y' is the # of the first Section after the last Section to be deleted.
You'd also need to replace the loop:
Code:
While .Sections.Count > 1
.Sections.First.Range.Characters.Last.Delete
Wend
with code that deletes the specified unwanted Sections. For example:
Code:
.Range(.Sections(x).Range.Start, .Sections(y).Range.Start - 1).Delete