Document.Type procedure builder

Document.Type (Word)

Returns the document type (template or document).

wdTypeDocument - Document, wdTypeFrameset - Frameset, wdTypeTemplate - Template.
If ActiveDocument.ActiveWindow.Type = wdWindowDocument Then 
 ActiveDocument.Styles("Heading 1") _ 
 .ParagraphFormat.Alignment = wdAlignParagraphCenter 
End If