Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-31-2019, 10:27 AM
edgar edgar is offline Replace style in all tables in a word document. Windows 10 Replace style in all tables in a word document. Office 2019
Novice
Replace style in all tables in a word document.
 
Join Date: Mar 2019
Posts: 3
edgar is on a distinguished road
Default Replace style in all tables in a word document.

Hello everyone.

I am trying to generate a macro code that will allow me to change all the styles in a word document. What seemed to me to be a simple function, it is starting to get really complicated since I can't manage to get it working.

So, I have googled what I thought it would be a perfect function:

Sub ApplyTableStyle()
Dim t As Table
For Each t In ActiveDocument.Tables
t.Style = "Light Shading - Accent 3"
Next
End Sub


And it changed the style of some of the tables, but not all of them. Some of the tables I have to click them individually and change its style individually.But I can only do it if I select the option "Apply and clear formatting" If I choose "Apply and maintain formating" it doesn't do anything.

Is there any way of overcoming this?

I have tried in two different laptops and it happens on both.. This document wasn't generated by me in the first place.. so Is there any way of clearing all the "nonsense" and do this from scratch?

Any ideas?

Thank you very much.



Regards,

Edgar
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace style in all tables in a word document. Using tables in a Word document oldyeller1938 Word Tables 4 03-17-2018 01:42 AM
Tables in Word Document - Formatting Networkrail Word Tables 0 08-22-2017 05:49 AM
When changing table style in Word 2010, font size seems to change but doesn't show in new tables heartsoulliving Word 1 12-07-2016 05:17 PM
Adding tables to Created word document whilst other word document open Help rpb925 Word VBA 18 03-30-2016 04:45 PM
Replace style in all tables in a word 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

Other Forums: Access Forums

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