For some reason JScript is not able to handle with the code converted from WinWord VBA.
Sub Macro1()
'
' Macro1 Macro
'
'
With ActiveDocument
.XMLSaveDataOnly = False
.XMLUseXSLTWhenSaving = True
.XMLSaveThroughXSLT = "file:///C:\z.xsl"
.XMLHideNamespaces = False
.XMLShowAdvancedErrors = True
.XMLSchemaReferences.HideValidationErrors = False
.XMLSchemaReferences.IgnoreMixedContent = False
.XMLSchemaReferences.ShowPlaceholderText = False
End With
ChangeFileOpenDirectory "C:\"
ActiveDocument.SaveAs2 _
FileName:="z.xml", _
FileFormat:=wdFormatXML, _
LockComments:=False, _
Password:="", _
AddToRecentFiles:=True, _
WritePassword:="", _
ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, _
SaveFormsData:=False, _
SaveAsAOCELetter:=False, _
CompatibilityMode:=0
End Sub
There are two files:
demo-not-work.js
demo-works.js
Only one difference between both of them:
some settings crashing the first script are commented (with //?
) in the second script to enable processing the script..