2 Replies Latest reply on Nov 1, 2015 4:36 PM by K159

    How to import rtf file?

    K159 Level 1

      Hi.

       

      I want to import file in a text frame.

       

      Txt file is possible. But rtf file bring up the with the code.

       

       

       

                  var FilePath = "c:/temp/txt/" + FileName;
                  var txtFile = new File(FilePath);
                  var txtFileContents;
          
                  if(txtFile.exists)
                  {
                      var txtFileOpenFlag = txtFile.open("r");
        
                      if(txtFileOpenFlag == true)
                      {
                          txtFileContents = txtFile.read();
                      }
                  }
                  app.selection[0].contents = txtFileContents;  
      

       

      How to import rtf file?

       

      Thanks.