Issue 375 - Additional error handling in the Word output provider.
This commit is contained in:
Mikael Karlsson
2025-11-13 20:24:03 +11:00
parent cd26450a10
commit e37a44dd87
+25 -4
View File
@@ -409,10 +409,31 @@ function Invoke-WordPostProcessItems
catch {}
#update fields, ToC etc.
$script:doc.Fields | ForEach-Object -Process { $_.Update() | Out-Null }
$script:doc.TablesOfContents | ForEach-Object -Process { $_.Update() | Out-Null }
$script:doc.TablesOfFigures | ForEach-Object -Process { $_.Update() | Out-Null }
$script:doc.TablesOfAuthorities | ForEach-Object -Process { $_.Update() | Out-Null }
try {
$script:doc.Fields | ForEach-Object -Process { $_.Update() | Out-Null }
}
catch {
Write-LogError "Failed to update document fields" $_.Exception
}
try {
$script:doc.TablesOfContents | ForEach-Object -Process { $_.Update() | Out-Null }
}
catch {
Write-LogError "Failed to update Table of Contents" $_.Exception
}
try {
$script:doc.TablesOfFigures | ForEach-Object -Process { $_.Update() | Out-Null }
}
catch {
Write-LogError "Failed to update Table of Figures" $_.Exception
}
try {
$script:doc.TablesOfAuthorities | ForEach-Object -Process { $_.Update() | Out-Null }
}
catch {
Write-LogError "Failed to update Table of Authorities" $_.Exception
}
Write-Log "Using document format: $($global:cbWordDocumentationFormat.SelectedValue)"
try {