4 Replies Latest reply on Oct 28, 2015 9:07 AM by carlm80163462

    doc.Save() taking forever to complete

    carlm80163462 Level 1

      Hi all,

       

      I have a script that iterates through a book and saves each FM file it finds as an RTF file; however, it takes 10+ sec for the doc.Save() call to complete, which seems like a lot. Just wondering if anyone else has had this problem with saving to RTF? Any insight is greatly appreciated.

       

      The function:

       

      function saveAsRtf(doc)

      {

          var path = doc.Name;

          var saveParams = GetSaveDefaultParams();

          var retParams = new PropVals();

          var index;

       

          index = GetPropIndex(saveParams, Constants.FS_FileType);

          saveParams[index].propVal.ival = Constants.FV_SaveFmtFilter;

          index = GetPropIndex(saveParams, Constants.FS_SaveFileTypeHint);

          saveParams[index].propVal.sval = "0001ADBIRTF         Microsoft RTF1.6";

       

          path = path.replace(/\.[^\.]+$/, ".rtf");

       

          doc.Save(path, saveParams, retParams);

       

          return;

      }

       

      - Carl