#1
|
|||
|
|||
Delete Selected Bookmarks
I have a document with 38 bookmarks and need help with:
1. Populating a multi-select list box on a user form with all the bookmarks in that document (friendly names like "Statement Reporting", and not "StatementReporting") 2. Allow the users to choose bookmarks which need to be retained and delete all "unchecked" bookmarks (both the name and the range) 3. Save the updated document as a new file (non-macro-enabled file) 4. Revert the master document with the macro to its original state Thank you so much for the help. Really appreciate your time. |
#2
|
|||
|
|||
What have tried? Few here are going to develop your project for you. If you want friendly names then you are going to have defined names that you can convert to friendly. Something like this to get you started:
Code:
Private Sub UserForm_Initialize() Dim oBM As Bookmark For Each oBM In ActiveDocument.Bookmarks ListBox1.AddItem Replace(oBM.Name, "_", " ") Next ListBox1.MultiSelect = fmMultiSelectMulti End Sub |
#3
|
|||
|
|||
Thanks, Greg. That's what I thought would be a way go to - define names as friendly as possible.
|
#4
|
||||
|
||||
Save the document as a macro enabled template and create new documents from it. The new document will always be a facsimile of the template, which in turn is not changed, whatever you do to the document.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
bookmarks, listbox |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Delete Bookmarks in Footnotes | brent chadwick | Word VBA | 3 | 12-24-2015 01:40 PM |
Delete Text when selected. | Eduardo Care | Word VBA | 1 | 11-03-2015 05:49 PM |
Form updating Bookmarks - writes to the bookmarks multiple times | PeterPlys | Word VBA | 13 | 01-14-2015 06:41 AM |
Delete starting number *) and delete Unneeded data in series | frustrated teacher | Word VBA | 5 | 12-07-2014 06:53 PM |
Macro Delete Selected Text | smonczka | Word VBA | 2 | 11-05-2011 03:18 AM |