View Single Post
 
Old 05-14-2024, 09:53 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

]I don't see why your SaveDoc macro is not executed when you open the template.
You can try putting a stop in the AutoOpen macro then when your code hits the step, stop through (with the F8 key) and troubleshoot. Maybe the CustomDocumentProperties.Count is not = 0


[CODE]Sub AutoOpen()
Stop
If ActiveDocument.CustomDocumentProperties.Count = 0 Then
ActiveDocument.CustomDocumentProperties.Add Name:="AlreadyProcessed",
LinkToContent:=False, Value:=1, Type:=msoPropertyTypeBoolean
FormatCaptions
CentreFigures
SaveDoc
Selection.HomeKey Unit:=wdStory
End If
End Sub[/CODE
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote