Saving text within a certain heading level ?

A

Alex

Hello everybody,

I'm looking for a macro that would save all the text within a certain
heading style to a separate word file.
If the cursor is positioned within a certain heading then I would like
the macro to save all text within this heading and all subheadings.

Does such a macro already exist ?
And if not, any idea how I can select in VBA all text below a
specified heading ?

Many thanks,

Axel
 
H

Helmut Weber

Hi Alex,

I think, once that what you want is selected,
saving it and copying to wherever you want,
would not be a problem.

Try: Selection.Bookmarks("\headinglevel").Select

See also help for predefined bookmarks.

You might also check whether you are in a heading paragraph:
MsgBox Selection.Style

Unfortunately, there are issues on localization with that.


HTH
 

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