5 Replies Latest reply on Jun 12, 2008 11:29 PM by (Dmitry1776)

    why doesnt applies masterpages?

      I check masterpage name under selected textframe and then want to apply this master to all next pages (up to the end of document):

      Set mInd = CreateObject("InDesign.Application.CS3")
      Set mDoc = mInd.ActiveDocument
      Set mFr = mInd.Selection.Item(1)
      curpage = mFr.Parent.Name
      lastpage = mDoc.Pages.LastItem
      mMaster = mFr.Parent.AppliedMaster.Name
      mInd.ActiveDocument.Pages.ItemByRange(curpage, lastpage).Item(1).AppliedMaster = mInd.ActiveDocument.MasterSpreads.Item(mMaster)

      BUT master page under next pages doesn't change. Why?

      P.S. This code DO work:

      For i = CInt(curpage) To CInt(lastpage)
      mInd.ActiveDocument.Pages.Item(i).AppliedMaster = mInd.ActiveDocument.MasterSpreads.Item(mMaster)
      Next