Заменить места, куда должно подставляться на значения [[Number]],[[RollN]],[[VCode]],[[RLength]]
Формат: wdFormatDocument97
Название файла: Номер рулона.doc
Наличие Word,Excel, PowerShell 2+:
Код:

# Входные файлы
$fWord = "C:\Doc\MyTemplate.doc"
$tmpPath = "C:\Doc\"
$fExcel = "C:\Doc\File.xls"
# Параметры замены
$ReplaceAll = 2
$FindContinue = 1
$MatchCase = $False
$MatchWholeWord = $True
$MatchWildcards = $False
$MatchSoundsLike = $False
$MatchAllWordForms = $False
$Forward = $True
$Wrap = $FindContinue
$Format = $False
$MSWord = New-Object -ComObject Word.Application
$MSExcel = New-Object -ComObject Excel.Application
$MSExcel.DisplayAlerts = $False
$wb = $MSExcel.Workbooks.Open($fExcel)
$ws = $wb.Worksheets.Item(1)
#Количество строк
$mainRng = $ws.UsedRange.Cells
$xRow = $mainRng.Rows.Count
for($i=2; $i -le $xRow; $i++)
{
$MSWord.Documents.Open($fWord)
#[[Number]]
$FindText = "[[Number]]"
$ReplaceText = $ws.Cells.Item($i,4).Value2
$MSWord.Selection.Find.Execute($FindText, $MatchCase, $MatchWholeWord, $MatchWildcards, $MatchSoundsLike, $MatchAllWordForms, $Forward, $Wrap, $Format, $ReplaceText, $ReplaceAll)
#[[RollN]]
$FindText = "[[RollN]]"
$ReplaceText = $ws.Cells.Item($i,1).Value2
$MSWord.Selection.Find.Execute($FindText, $MatchCase, $MatchWholeWord, $MatchWildcards, $MatchSoundsLike, $MatchAllWordForms, $Forward, $Wrap, $Format, $ReplaceText, $ReplaceAll)
#[[VCode]]
$FindText = "[[VCode]]"
$ReplaceText = $ws.Cells.Item($i,3).Value2
$MSWord.Selection.Find.Execute($FindText, $MatchCase, $MatchWholeWord, $MatchWildcards, $MatchSoundsLike, $MatchAllWordForms, $Forward, $Wrap, $Format, $ReplaceText, $ReplaceAll)
#[[RLength]]
$FindText = "[[RLength]]"
$ReplaceText = $ws.Cells.Item($i,2).Value2
$MSWord.Selection.Find.Execute($FindText, $MatchCase, $MatchWholeWord, $MatchWildcards, $MatchSoundsLike, $MatchAllWordForms, $Forward, $Wrap, $Format, $ReplaceText, $ReplaceAll)
$saveFormat = [Microsoft.Office.Interop.Word.WdSaveFormat]::wdFormatDocument97
$path = Join-Path $tmpPath "$($ws.Cells.Item($i,1).Value2).doc"
$MSWord.ActiveDocument.SaveAs([ref]$path, [ref]$saveFormat)
$MSWord.Documents.Close()
}
$MSWord.Quit()
$MSExcel.Quit()
[System.Runtime.InteropServices.Marshal]::ReleaseComObject($MSExcel)
[System.Runtime.InteropServices.Marshal]::ReleaseComObject($MSWord)