Macro to select current section

P

P Ratcliff

Hi All,

This is a dumb VBA question or, rather, a VBA question from a dummy. I
have a document with many chapters, each chapter is a section. I need
a macro to select the current section (i.e. whichever section I am
currently 'in'), the matching header/footer and endnotes and write it
out to a new document.

I can grab the first section, no problem:

Sub getsection()

ActiveDocument.Sections(1).Range.Select

End Sub


but I don't know how to replace Sections(1) with a 'current section'
or Me or something to indicate I want the section I'm 'in'. Can
someone tell me the syntax for this?

Thanks in advance,
P Ratcliff
 

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