А вот и решение по этому вопросу:
Цитата:
Большущее спасибо Petya V4sechkin и alexii aka Iska aka хорошие люди))
Цитата:
Option Explicit
Const wdDialogToolsTemplates = &H57
Dim strDocumentList
Dim strBadTemplate
Dim strDocument
Dim strTemplate
Dim objFSO
Dim objWord
strDocumentList = "E:\Песочница\0120\DocumentList.txt"
strBadTemplate = "\\fileserver2\USERS$\sba\My Documents\Brand Manual\Brand Manual\templates Norit russia\Templates NV\Norit NV - brief - ENG, V060403.dot"
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strDocumentList) Then
Set objWord = WScript.CreateObject("Word.Application")
With objFSO.OpenTextFile(strDocumentList)
Do Until .AtEndOfStream
strDocument = .ReadLine()
If objFSO.FileExists(strDocument) Then
WScript.Echo strDocument
With objWord.Documents.Open(strDocument)
strTemplate = objWord.Dialogs(wdDialogToolsTemplates).Template
If strTemplate = strBadTemplate Then
WScript.Echo " Template found in document [" & strDocument & "]"
.AttachedTemplate = "Normal.dotm"
.Save
End If
.Close
End With
Else
WScript.Echo "Document [" & strDocument & "] not found"
End If
Loop
.Close
End With
objWord.Quit
Set objWord = Nothing
Else
WScript.Echo "Document list [" & strDocumentList & "] not found"
End If
Set objFSO = Nothing
WScript.Quit 0
Большущее спасибо Petya V4sechkin и alexii aka Iska aka хорошие люди))