Well, as it seems, when started from the batch code, than a different kind of report file is created.
I've made some Word Macros to convert the file to the desired type. However, the Macros are far from perfect...
Anyway, maybe someone will find it useful.
You would call these macros from Perl like this:
system ("call \"C:\\Program Files\\Microsoft Office\\Office14\\WINWORD.EXE\" c:\\test.docx /mOTM_proof");
Sub OTM_proof()
Dim iResponse As Integer
Dim tTable As Table
Dim rw As Row
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
For Each tTable In ActiveDocument.Tables
If InStr(tTable.Cell(1, 1), "Seg") Then
For Each rw In tTable.Rows
If (InStr(rw.Cells(2), "AutoSubst") = 1) Then
rw.Delete
End If
Next rw
End If
Next
Application.ScreenUpdating = True Application.DisplayStatusBar = True
Application.ActiveDocument.Save Application.ActiveDocument.Close Application.Quit
End Sub
Sub OTM_validation()
Dim iResponse As Integer
Dim wdht As Integer
Dim myString As String
Dim r As Integer
Dim tTable As Table
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
For Each tTable In ActiveDocument.Tables
If InStr(tTable.Cell(1, 1), "Seg") Then
For r = 1 To tTable.Rows.Count
myString = tTable.Cell(r, 3).Range.FormattedText
myString = Left$(myString, Len(myString) - 2)
tTable.Cell(r, 2).Range.Text = myString
Next r
tTable.Columns(3).Delete
' column widths should be arranged...
End If
Next tTable
' insert the header from a template file
Documents.Open FileName:="C:\OTM\OTM_validation_template.docx", ReadOnly:=True
Selection.WholeStory
Selection.Copy
Application.ActiveDocument.Close
Selection.HomeKey Unit:=wdStory
Selection.Paste
Selection.TypeBackspace
Application.ScreenUpdating = True Application.DisplayStatusBar = True
Application.ActiveDocument.Save Application.ActiveDocument.Close Application.Quit
End Sub
Dear developers!
The documentation seems to be missing this information:
How to export a validation document for validation/proofreading with otmbatch?
So I'm trying to export 2 different validation documents, one for validation and one for proofreading.
This can be changed on the GUI by a radio button, but the otmbatch documentation misses this feature.
The proposed batch code creates the file for proofreading:
otmbatch /TA=DOCEXP /FLD=$projectID /ST=$workdir\\fileset /FI=*.* /OP=VALDOC /VAL=(DOC, COMBINE) /OVERWRITE=YES /QUIET=NOMSG
How can I automatically create a validation document for validation?
Thanks for your kind help!
András Ács