Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Sub CallChangeTemplates() ChangeTemplates "c:\temp\docs", "*.doc*" End Sub Sub ChangeTemplates(strFolder As String, strFilePattern As String) Dim strFileName As String Dim strFolders() As String Dim iFolderCount As Integer Dim i As Integer Dim Doc As Document 'collect child folders strFileName = Dir$(strFolder & "\", vbDirectory) Do Until strFileName = "" If (GetAttr(strFolder & "\" & strFileName) And vbDirectory) = vbDirectory Then If Left$(strFileName, 1) <> "." Then ReDim Preserve strFolders(iFolderCount) strFolders(iFolderCount) = strFolder & "\" & strFileName iFolderCount = iFolderCount + 1 End If End If strFileName = Dir$() Loop 'process files in current folder strFileName = Dir$(strFolder & "\" & strFilePattern) Do Until strFileName = "" DoEvents Set Doc = Documents.Open(strFolder & "\" & strFileName) Doc.AttachedTemplate = NormalTemplate Doc.Close wdSaveChanges strFileName = Dir$() Loop 'look through child folders For i = 0 To iFolderCount - 1 ChangeTemplates strFolders(i), strFilePattern Next i End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|VBA Userform: Can't get selected items in listbox from outside a hidden userform||6||55|
|Can I use VBA in Word to make a Table AutoFit to contents?||7||141|
|Password protect a PDF document created in Word - can it be done?||6||32|
|Word 2013 - Tracking Revisions - How to mark something as a revision that was missed earlier||5||29|
Join the community of 500,000 technology professionals and ask your questions.