Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-31-2016, 11:56 AM
sks27 sks27 is offline Delete Selected Bookmarks Windows 7 64bit Delete Selected Bookmarks Office 2013
Novice
Delete Selected Bookmarks
 
Join Date: May 2016
Posts: 2
sks27 is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 05-31-2016, 04:19 PM
gmaxey gmaxey is offline Delete Selected Bookmarks Windows 7 32bit Delete Selected Bookmarks Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 06-03-2016, 12:19 AM
sks27 sks27 is offline Delete Selected Bookmarks Windows 7 64bit Delete Selected Bookmarks Office 2013
Novice
Delete Selected Bookmarks
 
Join Date: May 2016
Posts: 2
sks27 is on a distinguished road
Default

Thanks, Greg. That's what I thought would be a way go to - define names as friendly as possible.
Reply With Quote
  #4  
Old 06-03-2016, 02:05 AM
gmayor's Avatar
gmayor gmayor is offline Delete Selected Bookmarks Windows 10 Delete Selected Bookmarks Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Quote:
Originally Posted by sks27 View Post
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.
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
Reply With Quote
Reply

Tags
bookmarks, listbox

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Selected Bookmarks Delete Bookmarks in Footnotes brent chadwick Word VBA 3 12-24-2015 01:40 PM
Delete Selected Bookmarks Delete Text when selected. Eduardo Care Word VBA 1 11-03-2015 05:49 PM
Delete Selected Bookmarks Form updating Bookmarks - writes to the bookmarks multiple times PeterPlys Word VBA 13 01-14-2015 06:41 AM
Delete Selected Bookmarks Delete starting number *) and delete Unneeded data in series frustrated teacher Word VBA 5 12-07-2014 06:53 PM
Delete Selected Bookmarks Macro Delete Selected Text smonczka Word VBA 2 11-05-2011 03:18 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft