0 Replies Latest reply on Apr 7, 2012 7:40 PM by jaloren28

    How do I cancel the open method if there's an unresolved text inset in the doc?

    jaloren28

      According to the FDK reference guide, the open parameter FS_RefFileNotFound means "Document imports another file that isn’t available." One of the supported values for this parameter is FV_DoCancel, which cancels the open operation. So before calling the open operation, I specifically set this parameter's value to FV_DoCancel. I assumed that if i did that and the document has an unresolved text inset, then the document would not open. But it does. What am I missing?

       

      Code is as follows:

       

       

         var vFileName='C:\\testing\\test.fm'

          var vOpenParams=GetOpenDefaultParams();

          var vReturnParams=new PropVals();

          var index;

         

          index=GetPropIndex(vOpenParams,Constants.FS_RefFileNotFound);

          vOpenParams[index].propVal.ival=Constants.FV_DoCancel;

       

         

          var vDoc=Open (vFileName,vOpenParams,vReturnParams)  

          if (FA_errno!=0)

          {

        

              if (CheckStatus (vReturnParams,Constants.FV_CancelReferencedFilesNotFound))

              {

                  Err ('ERROR: '+vFileName+' was not opened because the document imports files that cannot be found. Verify there are no unresolved text insets in the document. \n')

                  }  

             

              }