Macro/Code to Delete Current Section

M

Mickey

Anybody know the code to delete the current section in a Word 2000 document.
I know the code for deleting section 1, 2, 3, etc. but I need the code for
the current section.

Thanks in advance.
Mickey
 
H

Helmut Weber

Hi Mickey,

Sub Test007()
Selection.Collapse ' just in case
Selection.Sections(1).Range.Delete
End Sub

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
K

Keith G Hicks

Micky,

Could you post your code for deleting specific sections (not the current one
but by section #)?

Thanks,

Keith
 
F

fumei via OfficeKB.com

ActiveDocument.Sections(2).Range.Delete

will delete Section 2.

This may, or may not, have unwanted effects on any headers and footers. It
depends on how they are set up and your use of SameAsPrevious.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top