Link to home
Start Free TrialLog in
Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on

Create bookmarks for sections using VBA

Dear Experts:

I would like to automatically (using VBA) add bookmarks to my multi-section document ...
... with each bookmark encompassing all the text of the respective section.

The bookmark names are to be based on a paragraph in each section that are formatted with a custom paragraph style.

User generated image
I have attached a sample file for your convenience.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas

add_bookmarks_based_on_sections.docx
Avatar of Andreas Hermle
Andreas Hermle
Flag of Germany image

ASKER

Hi Rgonzo,

great, works like a charm, thank you very,very  much for it.

There is one thing I should have been more specific in my inital question:
"... The bookmark names are to be based on a paragraph in each section that are formatted with a custom paragraph style."

That custom paragraph style is called 'My_Custom_Style' and I have attached a new sample file to better show my case, i.e. the bookmark names should reflect that particular paragraph text.

The one and only paragraph of each section formatted with this custom paragraph style is not necessarily the first paragraph of each section.

Thank you very much in advance

Regards, Andreas

User generated imageadd_bookmarks_based_on_paragraph_st.docx
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wow, great, exactly what I was looking for. A real great job, Rgonzo, thank your very mcuh for your professional and quick help.

Regards, Andreas