Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-15-2019, 06:26 AM
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
Question Why are style updates in VBA not reflected in the document?

Greetings. I have been coding VBA and vb.net for 15 years. I have made dozens of time-saving add-ins, applications, and macros in word, excel, access, and powerpoint. I have a question to which I cannot find an answer. I only wish to know "why".

I do not seek an alternative method for doing this (unless it's easy ;-)). I don't have code to show you. I know all about the virtues and vices of style templates. I do not seek to be chastised for wanting to do something so stupid. I only want to know why something does not work.



OK - with that as the caveat - If I am in a word document and select modify a style, select the font and change it from Arial to Times New Roman, when I am done with the dialogue all the text of that style changes from Arial to Times New Roman in the document text.

If I do the exact same thing in VBA, (find the style from the styles collection and modify the font) the text does not update. I run my code and examine the style in the style manager dialogue box I can see my changes (the font for the style shows Times New Roman), yet the text in the document stubbornly stays Arial. Why?

I can force the update by looping through the paragraph collection and applying the style (!) but I don't want to do that.

I have searched and searched and cannot find an answer to this question. Maybe one of you knows.
Reply With Quote
 



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 09:02 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