Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #18  
Old 07-16-2025, 06:33 AM
Charles Kenyon Charles Kenyon is offline Formatting applied to one paragraph affects the entire document. Windows 11 Formatting applied to one paragraph affects the entire document. Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,536
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I prefer to have the TOC, Table of Figures and Table of Authorities styles Auto Update.
Here is the macro based on the one for proofing language.
Code:
Sub NormalStylesAutoUpdateOff()
    '   Written 16 July 2025
    '   Charles Kenyon
    '   Intended to set all styles in Normal template (except those used in TOC, TOF, or TOA) to not automatitically update
    '   Use right after opening Word
    '
    ' https://www.msofficeforums.com/word/...-document.html
    '
    Application.ScreenUpdating = False
    Application.NormalTemplate.OpenAsDocument
    Dim aStyle As Style
    On Error Resume Next    ' Some styles have no language attribute and will give an error
    For Each aStyle In ActiveDocument.Styles
        Select Case aStyle.NameLocal
            Case "TOC 1", "TOC 2", "TOC 3", "TOC 4", "TOC 5", "TOC 6", "TOC 7", "TOC 8", "TOC 9", _
                 "Table of Figures", "Table of Authorities"
                Let aStyle.AutomaticallyUpdate = True
            Case Else
                Let aStyle.AutomaticallyUpdate = False
        End Select
        Let aStyle.NoProofing = False   ' also turn on spelling and grammar checking
    Next aStyle
    Let ActiveDocument.UpdateStylesOnOpen = False    ' For information on using this line, see:
    '       http://www.shaunakelly.com/word/shar...matchange.html
    ActiveDocument.Close SaveChanges:=True
    Let Application.ScreenUpdating = True
    Application.ScreenRefresh
    MsgBox title:="All done!", prompt:="All non-TOC styles in the Normal template set to not automatically update."
    On Error GoTo -1
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting applied to one paragraph affects the entire document. Macro to search for a particular word, copy the entire paragraph to a new document Productivity Word VBA 2 10-25-2019 06:40 AM
Word 2003: Font change is applied to entire document (should not) ugcheleuce Word 1 11-05-2018 05:25 AM
Formatting applied to entire document PoseidonofSea Word 2 03-08-2018 11:59 AM
Formatting applied to one paragraph affects the entire document. How to select and copy to clipboard an entire document except for a paragraph and keep formatting TD_123 Word VBA 7 06-16-2015 03:30 PM
Formatting applied to one paragraph affects the entire document. align just ONE paragraph, not the entire document vcolemonts Word 1 02-18-2014 09:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:08 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