selecting sections

R

robert

Please excuse the simplicity of this question - I'm new
to this with only the macro recorder as my teacher.

What code will allow me to automate the action of
selecting the contents of a specific section of a
document and copying it to the clipboard?

Thanks
Robert
 
C

Chad DeMeyer

Robert,

Assuming that the selection was already in that section when you ran the
macro, it would look like this:

Sub CopySection()
Selection.Sections(1).Range.Copy
End Sub

If you can't depend on the selection already being in that section but you
knew, for instance, that it would always be section 3 of a document:

Sub CopySection()
ActiveDocument.Sections(3).Range.Copy
End Sub

Regards,
Chad
 

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