Dim myID As InDesign.Application
Dim myTextFrame As TextFrame
Set myID = CreateObject("InDesign.Application.CS")
Set myTextFrame = myID.Selection(1)
For i = 1 To 5
myLayerName = "Layer " + Trim(Str(i))
myTextFrame.ItemLayer = myID.ActiveDocument.Layers(myLayerName)
Next
Dim myID As InDesign.Application
Dim myTextFrame As TextFrame
Set myID = CreateObject("InDesign.Application.CS")
Set myTextFrame = myID.Selection(1)
For i = 1 To 5
myLayerName = "Layer " + Trim(Str(i))
myTextFrame.Move myID.ActiveDocument.Layers(myLayerName)
Next
Set myInDesign = CreateObject("InDesign.Application.CS2")
Set myDocument = myInDesign.ActiveDocument
Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
myTextFrame.ItemLayer = myDocument.Layers.Item("Layer 3")
myTextFrame.GeometricBounds = Array(0, 0, 1082, 782)
myTextFrame.Place "C:\file1.pdf"
Set myTextFrame = myDocument.Pages.Item(2).TextFrames.Add
myTextFrame.ItemLayer = myDocument.Layers.Item("Layer 3")
myTextFrame.GeometricBounds = Array(0, 0, 1082, 782)
myTextFrame.Place "C:\file2.pdf"