diff --git a/word/Editor/Serialize2.js b/word/Editor/Serialize2.js index 4a1c2f6c03f99ac3ce162477959cdec6eacc56af..64acc1d228eb7406056a7364c0b6efcb3e66cc5a 100644 --- a/word/Editor/Serialize2.js +++ b/word/Editor/Serialize2.js @@ -4238,6 +4238,26 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa }); } } + else if (fieldtype_FORMTEXT === item.Get_FieldType()){ + if(this.saveParams && this.saveParams.bMailMergeDocx) + oThis.WriteParagraphContent(item, bUseSelection, false); + else + { + var Instr = "FORMTEXT"; + for(var j = 0; j < item.Arguments.length; ++j){ + var argument = item.Arguments[j]; + argument = argument.replace(/(\\|")/g, "\\$1"); + if(-1 != argument.indexOf(' ')) + argument = "\"" + argument + "\""; + Instr += " " + argument; + } + for(var j = 0; j < item.Switches.length; ++j) + Instr += " \\" + item.Switches[j]; + this.bs.WriteItem(c_oSerParType.FldSimple, function () { + oThis.WriteFldSimple(Instr, function(){oThis.WriteParagraphContent(item, bUseSelection, false);}); + }); + } + } break; case para_Hyperlink: this.bs.WriteItem(c_oSerParType.Hyperlink, function () { @@ -9349,6 +9369,11 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, curFoo if (editor) editor.WordControl.m_oLogicDocument.Register_Field(oRes); } + else if ("FORMTEXT" == sFieldType){ + oRes = new ParaField(fieldtype_FORMTEXT, aArguments, aSwitches); + if (editor) + editor.WordControl.m_oLogicDocument.Register_Field(oRes); + } return oRes; } this.ReadImage = function(type, length, img)