Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #15  
Old 10-21-2017, 07:03 AM
datech-hh datech-hh is offline Update Styleref Fields Windows 10 Update Styleref Fields Office 2016
Novice
Update Styleref Fields
 
Join Date: Oct 2017
Posts: 9
datech-hh is on a distinguished road
Default

At the moment they have to consider own headlines styles and textstructure styles. I'm using a function to detect those styles. I'm also using the "range" object instead of selection, because the user will change styles by selecting only the first line. If this line (Paragraph beginnig with 1.2) is selcted changed (eg by click on a button) i Loop to all paragraphs until the next concerned style occurs. In my example the Loop runs to the Paragraph beginning with "2". Now i can change the text of the Styleref Fields

Fixing the range:
Set ranActRange = ActiveDocument.Range(Start:=ActiveDocument.Paragra phs(intI).Range.Start, End:=ActiveDocument.Paragraphs(x - 1).Range.End)

x is the "For" counter of currently checked Paragraph. x-1 because Paragraph x is out of the concernd range that is supposed to be updated.

Now i can Change the fields as suggested exactly as in your method.

For Each fld In ranActRange.Fields
...
..
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Styleref Fields How do I update all fields from a new input Kozzzle Word 7 10-19-2017 06:12 PM
how to update calculated fields sectionbreak Mail Merge 4 06-04-2014 12:12 AM
Macro to update fields rhatx Word VBA 0 03-02-2011 12:14 PM
VBA to update certain (but not all) fields sparkyrose Word VBA 0 05-20-2010 12:50 PM
Can no longer update fields! slindsay Word 0 09-03-2009 05:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:53 AM.


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