Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-21-2018, 11:13 PM
MORZ68 MORZ68 is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2016
Novice
Style to be used in all documents (new and old)
 
Join Date: Mar 2018
Posts: 5
MORZ68 is on a distinguished road
Smile Style to be used in all documents (new and old)


Hi

I've put a style into Normal.dot, but obviously each time I open an old document/template they are not there.

I know the organiser, but too much to do each document. Plus format painter, but again, would rather just have the style in all documents, old and new.

Thanks
Reply With Quote
  #2  
Old 03-22-2018, 04:38 AM
Guessed's Avatar
Guessed Guessed is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You need to refresh the styles from the template in order to import the styles from the attached template into the currently active document.

Via the interface, you do this by ticking the setting of Developer Tab > Document Template > Automatically update document styles and pressing the OK button. Once this is done, I would recommend you go back into that dialog and turn it off again.

The developer tab is not active by default in Word. If you haven't shown yours, go to File > Options > Customise Ribbon to turn it on.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 03-22-2018, 06:35 AM
Charles Kenyon Charles Kenyon is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
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

You probably do not want to leave that option turned on.
What happens when I send my document to someone else? Will Word mess up my formatting?

Quote:
too much to do each document
Seriously?

Put the following macro in your normal template:

Code:
Sub UpdateMyStyleOnOpen()
' Charles Kenyon 2018-03-22
' https://www.msofficeforums.com/word/38569-style-used-all-documents-new-old.html#post126054
'
' UpdateMyStyleOnOpen Macro
' Copies named style from normal template to any document that is opened, overwriting existing style
'
' Rename as AutoOpen (instead of UpdateMyStyleOnOpen) and store in Normal.dotm template.
' Set variable strMyStyle to contain the name of style to be updated
'
'
    Dim strMyStyle As String
    strMyStyle = "Body Text"
       ' change this to be the style you want
       ' must enclose name in quotation marks
    '
    Application.OrganizerCopy Source:=ThisDocument.fullname _
        , Destination:=ActiveDocument.fullname, Name:=strMyStyle, _
        Object:=wdOrganizerObjectStyles
End Sub
Again, you need to change the name from UpdateMyStyleOnOpen to AutoOpen and change the name of your target style from Body Text to the name you want.

Installing Macros

If you already have an AutoOpen macro, do not rename, but instead add the following line to the existing macro:
UpdateMyStyleOnOpen
Reply With Quote
  #4  
Old 03-22-2018, 04:07 PM
Guessed's Avatar
Guessed Guessed is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

There is an alternative to Charles' focused approach which imports a single style from a specific template.

I use a much broader approach. The following macro will import every style from the attached template. The attached template is not always the Normal template but if you created the document yourself and didn't pay attention to which template you used then in all likelihood it is Normal.dotm.

Code:
Sub RefreshStylesFromTemplate()
   ActiveDocument.UpdateStyles
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 03-22-2018, 04:35 PM
Charles Kenyon Charles Kenyon is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
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

Quote:
Originally Posted by Guessed View Post
There is an alternative to Charles' focused approach which imports a single style from a specific template.

***
Hi Andrew,

It imports a single style from the template that holds the macro (ThisDocument). If my advice is followed, that is the normal template. If named AutoOpen, it runs anytime any document (or template) is opened regardless of what is the attached template.
Reply With Quote
  #6  
Old 03-23-2018, 01:53 AM
MORZ68 MORZ68 is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2016
Novice
Style to be used in all documents (new and old)
 
Join Date: Mar 2018
Posts: 5
MORZ68 is on a distinguished road
Default Thanks so much! Works on my home computer, now to do it at work!

Thanks so much! Works on my home computer, now to do it at work!
Reply With Quote
  #7  
Old 03-27-2018, 11:19 PM
MORZ68 MORZ68 is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2016
Novice
Style to be used in all documents (new and old)
 
Join Date: Mar 2018
Posts: 5
MORZ68 is on a distinguished road
Smile It works, but I get an error when I open Word :-)

It comes up and says "command failed". Simple little dialog, but then continues. Bit annoying each time... any suggestions? Thanks M
Reply With Quote
  #8  
Old 03-29-2018, 12:20 AM
Guessed's Avatar
Guessed Guessed is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Which macro are you using? If the command is failing then it would help to know what your actual code is before hypothesizing on reasons why it might fail.

For instance, the one liner I supplied might fail if you ran it on a template instead of a document.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #9  
Old 03-29-2018, 03:40 PM
MORZ68 MORZ68 is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2016
Novice
Style to be used in all documents (new and old)
 
Join Date: Mar 2018
Posts: 5
MORZ68 is on a distinguished road
Default I'm using this one

Sub UpdateMyStyleOnOpen()
' Charles Kenyon 2018-03-22
' https://www.msofficeforums.com/word/...tml#post126054
'
' UpdateMyStyleOnOpen Macro
' Copies named style from normal template to any document that is opened, overwriting existing style
'
' Rename as AutoOpen (instead of UpdateMyStyleOnOpen) and store in Normal.dotm template.
' Set variable strMyStyle to contain the name of style to be updated
'
'
Dim strMyStyle As String
strMyStyle = "Body Text"
' change this to be the style you want
' must enclose name in quotation marks
'
Application.OrganizerCopy Source:=ThisDocument.fullname _
, Destination:=ActiveDocument.fullname, Name:=strMyStyle, _
Object:=wdOrganizerObjectStyles
End Sub
Reply With Quote
  #10  
Old 03-29-2018, 07:00 PM
Charles Kenyon Charles Kenyon is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
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

Try

Code:
Sub UpdateMyStyleOnOpen()
' Charles Kenyon 2018-03-22
' https://www.msofficeforums.com/word/3...tml#post126054
'
' UpdateMyStyleOnOpen Macro
' Copies named style from normal template to any document that is opened, overwriting existing style
'
' Rename as AutoOpen (instead of UpdateMyStyleOnOpen) and store in Normal.dotm template.
' Set variable strMyStyle to contain the name of style to be updated
'
'
    Dim strMyStyle As String
    strMyStyle = "Body Text"
       ' change this to be the style you want
       ' must enclose name in quotation marks
    '
    On Error Resume Next
    Application.OrganizerCopy Source:=ThisDocument.fullname _
        , Destination:=ActiveDocument.fullname, Name:=strMyStyle, _
        Object:=wdOrganizerObjectStyles
End Sub

Last edited by Charles Kenyon; 03-30-2018 at 03:43 AM.
Reply With Quote
  #11  
Old 03-29-2018, 11:43 PM
MORZ68 MORZ68 is offline Style to be used in all documents (new and old) Windows 10 Style to be used in all documents (new and old) Office 2016
Novice
Style to be used in all documents (new and old)
 
Join Date: Mar 2018
Posts: 5
MORZ68 is on a distinguished road
Default Vba

Thank you! :-)
Reply With Quote
Reply

Tags
#global style, #styles, #template



Similar Threads
Thread Thread Starter Forum Replies Last Post
Style to be used in all documents (new and old) Apply Heading Style When Combining Documents snot369 Word 1 01-13-2017 11:04 AM
Style to be used in all documents (new and old) Writing multiple documents of a certain style. Darkstar_ Word 2 09-30-2016 12:02 PM
Style to be used in all documents (new and old) How can I change the default style set so that it automatically applies to all documents? writty Word 3 08-16-2015 09:47 AM
Make a new Style available in legacy documents BlueClearSky Word 3 11-22-2013 03:12 PM
Style to be used in all documents (new and old) Change font style and size in multiple documents fitkhan Word 1 04-27-2011 09:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:33 AM.


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