3 Replies Latest reply on Dec 25, 2012 5:16 AM by BEGINNER_X

    Copy from Doc1 and paste in Doc2

    BEGINNER_X Level 3

      HI ALL,

       

       

      Requirement:

       

      My requirement is copy all pageitem from Source Document(doc1) and paste in Target Document(doc2).

       

      [Note: doc1 contains many pages]

       

      Trying Code:

       

      It will paste Ist page only. Not repeated for next process.

       

       

      var doc1 = app.documents[0];

      var doc2 = app.documents[1];

       

      for(i=0; i<doc1.pages.length; i++)

      {

          //var myPages = Pages[i]

          //alert(Pages[i])

          doc1.pages[i].pageItems.everyItem().select(SelectionOptions.ADD_TO);

          app.copy ();

          app.activeDocument = doc2;

          app.pasteInPlace ();

          }

       

      Kindly check and advise.

       

      Thanks in advance

      BEGINNER