VBScript 在不启用兼容模式的情况下将 DOC 转换为 DOCX

VBScript to convert DOC to DOCX without Compatibility Mode enabled

我下面的 VBScript 将 Word DOC 转换为 DOCX:

Set oFSO = CreateObject("Scripting.FileSystemObject")
fullpath = oFSO.GetAbsolutePathName(Wscript.Arguments.Item(0))
justpath = Left(fullpath, InStrRev(fullpath, "\"))
basename = oFSO.GetBaseName(fullpath)
doxpath = justpath & basename & ".docx" 
Set oWord = CreateObject("Word.Application")
Set doc = oWord.Documents.Open(fullpath)
doc.SaveAs2 doxpath, 16
doc.Close
oWord.Quit
Set oFSO = Nothing

但是,当我打开输出 DOCX 时,它在顶部显示“[兼容模式]”。是否有一些 属性 我可以设置或调用 before/during/after SaveAs2 调用的方法,这样就不会发生这种情况?

现在可以了。谢谢 Tomalak!

Set oFSO = CreateObject("Scripting.FileSystemObject")
fullpath = oFSO.GetAbsolutePathName(Wscript.Arguments.Item(0))
justpath = Left(fullpath, InStrRev(fullpath, "\"))
basename = oFSO.GetBaseName(fullpath)
doxpath = justpath & basename & ".docx" 
Set oWord = CreateObject("Word.Application")
Set doc = oWord.Documents.Open(fullpath)
'FileFormat = wdFormatDocumentDefault = 16 = Word default document file format. For Word, this is the DOCX format.
'CompatibilityMode = wdCurrent = 65535 = Compatibility mode equivalent to the latest version of Word.
doc.SaveAs2 doxpath, 16, , , , , , , , , , , , , , , 65535
doc.Close
oWord.Quit
Set oFSO = Nothing