Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-07-2018, 04:00 AM
ldoodle ldoodle is offline Word Sections - Bookmarks Windows 10 Word Sections - Bookmarks Office 2010 32bit
Novice
Word Sections - Bookmarks
 
Join Date: Oct 2018
Posts: 17
ldoodle is on a distinguished road
Default Word Sections - Bookmarks

Hi,

Is it possible to make a section a bookmark? What I need to do is change a style for an entire section. This may sound obvious as I could refer to the section by number:

Code:
ActiveDocument.Range.Sections(2).Range.style = "StyleName"
But what if the section number is different between documents. I looked a giving sections a name but that doesn't seem possible, so I thought about putting a bookmark and referring to that bookmark name in code.

Thanks!
Reply With Quote
  #2  
Old 11-07-2018, 04:06 AM
gmayor's Avatar
gmayor gmayor is offline Word Sections - Bookmarks Windows 10 Word Sections - 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

You can certainly bookmark a complete section, just as you can bookmark other pieces of text, but if you are running code on a piece of text that has variable numbers of sections, do you not have another means of identifying which section you wish to apply paragraph formatting? What determines whether the section needs this format?
__________________
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
  #3  
Old 11-07-2018, 05:56 AM
ldoodle ldoodle is offline Word Sections - Bookmarks Windows 10 Word Sections - Bookmarks Office 2010 32bit
Novice
Word Sections - Bookmarks
 
Join Date: Oct 2018
Posts: 17
ldoodle is on a distinguished road
Default

I think you're right, but I was hoping to not have to highlight loads of text to make the whole lot a bookmark, rather just make the whole section a bookmark. If you get what I mean.

These are external documents from many sources, so unfortunately I have no single identifier to check for, so my initial idea was wrap what needs to be changed with section breaks but then I realised there could be existing sections elsewhere.

Thanks for your help.
Reply With Quote
  #4  
Old 11-07-2018, 07:04 AM
gmayor's Avatar
gmayor gmayor is offline Word Sections - Bookmarks Windows 10 Word Sections - 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

If you are inserting them with VBA, format them as you insert them.
__________________
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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Sections - Bookmarks Word VBA - "Page left Blank" between Sections to make all Sections start on even page Cov_ATC Word VBA 10 11-28-2021 03:41 PM
Word Sections - Bookmarks Deleting only all bookmarks contents not the bookmarks adilprodigy Word VBA 1 10-11-2017 01:31 PM
Word Sections - Bookmarks Form updating Bookmarks - writes to the bookmarks multiple times PeterPlys Word VBA 13 01-14-2015 06:41 AM
Word Sections - Bookmarks selecting ms word bookmarks using vba dnc Word VBA 4 05-10-2013 04:58 PM
word 2007 bookmarks Dawn Word 0 07-14-2009 01:00 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:51 AM.


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