Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
EKH EKH is offline
external usenet poster
 
Posts: 15
Default Template is set to Automatically Update Document Styles - Word 200

I have 850 templates that are set to Automatically Update Document Styles.
Of course, this is a problem as we want to be able to modify styles on the
documents based on these templates without having to change this setting each
time. My goal is to fix the templates.

I know I can change the setting with the following code:

With ActiveDocument
.UpdateStylesOnOpen = False
End With

My real challenge is how to run this on 850 templates. Any ideas?


  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default Template is set to Automatically Update Document Styles - Word 200

Assuming that all of the templates are in the same folder, something like
this could be used (the code is from the article at
http://word.mvps.org/faqs/macrosvba/BatchFR.htm):

Public Sub BatchModifyDocSettings()

Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document

PathToUse = "H:\Test\" 'specify the path here

'Error handler to handle error generated whenever
'the FindReplace dialog is closed

On Error Resume Next

'Close all open documents before beginning

Documents.Close SaveChanges:=wdPromptToSaveChanges


'Set the directory and type of file to batch process
'(Note that Word 2007 also supports *.dotx and *.dotm
'templates.)

myFile = Dir$(PathToUse & "*.dot")

While myFile ""

'Open document
Set myDoc = Documents.Open(PathToUse & myFile)

myDoc.UpdateStylesOnOpen = False
myDoc.Saved = False
'Close the modified document after saving changes

myDoc.Close SaveChanges:=wdSaveChanges

'Next file in folder

myFile = Dir$()

Wend

End Sub

--
Stefan Blom
Microsoft Word MVP


"EKH" wrote in message
...
I have 850 templates that are set to Automatically Update Document Styles.
Of course, this is a problem as we want to be able to modify styles on the
documents based on these templates without having to change this setting
each
time. My goal is to fix the templates.

I know I can change the setting with the following code:

With ActiveDocument
.UpdateStylesOnOpen = False
End With

My real challenge is how to run this on 850 templates. Any ideas?







  #3   Report Post  
Posted to microsoft.public.word.docmanagement
EKH EKH is offline
external usenet poster
 
Posts: 15
Default Template is set to Automatically Update Document Styles - Word

Fantastic!!! Worked like a charm. Thanks so much!

"Stefan Blom" wrote:

Assuming that all of the templates are in the same folder, something like
this could be used (the code is from the article at
http://word.mvps.org/faqs/macrosvba/BatchFR.htm):

Public Sub BatchModifyDocSettings()

Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document

PathToUse = "H:\Test\" 'specify the path here

'Error handler to handle error generated whenever
'the FindReplace dialog is closed

On Error Resume Next

'Close all open documents before beginning

Documents.Close SaveChanges:=wdPromptToSaveChanges


'Set the directory and type of file to batch process
'(Note that Word 2007 also supports *.dotx and *.dotm
'templates.)

myFile = Dir$(PathToUse & "*.dot")

While myFile ""

'Open document
Set myDoc = Documents.Open(PathToUse & myFile)

myDoc.UpdateStylesOnOpen = False
myDoc.Saved = False
'Close the modified document after saving changes

myDoc.Close SaveChanges:=wdSaveChanges

'Next file in folder

myFile = Dir$()

Wend

End Sub

--
Stefan Blom
Microsoft Word MVP


"EKH" wrote in message
...
I have 850 templates that are set to Automatically Update Document Styles.
Of course, this is a problem as we want to be able to modify styles on the
documents based on these templates without having to change this setting
each
time. My goal is to fix the templates.

I know I can change the setting with the following code:

With ActiveDocument
.UpdateStylesOnOpen = False
End With

My real challenge is how to run this on 850 templates. Any ideas?








  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default Template is set to Automatically Update Document Styles - Word

I'm glad it worked for you. Note, however, that Ibby, the author of the
linked article, deserves (most of) the credit.

--
Stefan Blom
Microsoft Word MVP


"EKH" wrote in message
...
Fantastic!!! Worked like a charm. Thanks so much!

"Stefan Blom" wrote:

Assuming that all of the templates are in the same folder, something like
this could be used (the code is from the article at
http://word.mvps.org/faqs/macrosvba/BatchFR.htm):

Public Sub BatchModifyDocSettings()

Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document

PathToUse = "H:\Test\" 'specify the path here

'Error handler to handle error generated whenever
'the FindReplace dialog is closed

On Error Resume Next

'Close all open documents before beginning

Documents.Close SaveChanges:=wdPromptToSaveChanges


'Set the directory and type of file to batch process
'(Note that Word 2007 also supports *.dotx and *.dotm
'templates.)

myFile = Dir$(PathToUse & "*.dot")

While myFile ""

'Open document
Set myDoc = Documents.Open(PathToUse & myFile)

myDoc.UpdateStylesOnOpen = False
myDoc.Saved = False
'Close the modified document after saving changes

myDoc.Close SaveChanges:=wdSaveChanges

'Next file in folder

myFile = Dir$()

Wend

End Sub

--
Stefan Blom
Microsoft Word MVP


"EKH" wrote in message
...
I have 850 templates that are set to Automatically Update Document
Styles.
Of course, this is a problem as we want to be able to modify styles on
the
documents based on these templates without having to change this
setting
each
time. My goal is to fix the templates.

I know I can change the setting with the following code:

With ActiveDocument
.UpdateStylesOnOpen = False
End With

My real challenge is how to run this on 850 templates. Any ideas?












Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"automatically update document styles" in word 2007 joshuasq Microsoft Word Help 1 May 18th 07 03:05 AM
How can I update Styles automatically? Ronald Roberts Microsoft Word Help 5 January 31st 06 03:55 PM
Save 'Automatically update document styles' option to template sooz Microsoft Word Help 1 October 25th 05 11:32 AM
REF fields don't update automatically in template Marek Microsoft Word Help 1 May 21st 05 01:03 AM
How do you REALLY turn off automatically update styles in Word 200 College Student Microsoft Word Help 1 January 8th 05 11:17 PM


All times are GMT +1. The time now is 09:12 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"