Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2019, 10:04 AM
kilroy kilroy is offline Why are style updates in VBA not reflected in the document? Windows 10 Why are style updates in VBA not reflected in the document? Office 2016
Competent Performer
 
Join Date: Sep 2016
Location: Southern Ontario
Posts: 122
kilroy is on a distinguished road
Default

If it's one thing I've learned here it's if your code doesn't work you've done something wrong and it's your fault. You can't share code why? Have a better attitude if you want help.

This works for me:

Code:
Sub ModifyStyle()
'
'
'
    Selection.Find.ClearFormatting
    Selection.Find.Style = ActiveDocument.Styles("Quote") 'Your Style Here
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Size = 14
    Selection.Find.Replacement.Font.Bold = True
    Selection.Find.Replacement.Font.Italic = True
    With Selection.Find
        .Text = "?"
        .Replacement.Text = "^&"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchByte = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Reply With Quote
  #2  
Old 02-15-2019, 03:03 PM
FlyingBlind FlyingBlind is offline Why are style updates in VBA not reflected in the document? Windows 10 Why are style updates in VBA not reflected in the document? Office 2016
Novice
Why are style updates in VBA not reflected in the document?
 
Join Date: Feb 2019
Posts: 3
FlyingBlind is on a distinguished road
Default Lol!

Thanks for the laugh! I needed it today
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do I stop automatic style updates for Word 2013 Lupe71903 Word 2 02-27-2018 01:48 PM
Why are style updates in VBA not reflected in the document? A mystery: how to hop about in a document, inserting updates in a single, new font? markh10178 Word 3 11-26-2015 04:07 PM
Why are style updates in VBA not reflected in the document? Updates tries to install Office 2010 updates which I don't use jlumbtx Office 1 03-13-2015 04:50 PM
Why are style updates in VBA not reflected in the document? Use multiple style sets in the same Word document (depending on which section the style is in) Ricyteach Word VBA 6 03-09-2015 07:11 PM
Automating document updates with new text wordfoolish2 Word 0 01-04-2011 01:01 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:56 PM.


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