1 Reply Latest reply on Jun 14, 2012 3:04 PM by CarlosCanto

    CS6 duplicate function causes Run-time error in VB6


      After upgrading from CS3 to CS6 the duplicate function is now causing runtime error "Type Mismatch". Error occurs on the last line of code.

      All am I trying to achieve is to duplicate a rectangle containing an EPS from one document into another document. The method appears to work but assigning a pageitem value as a function fails.


           Dim moInDesign         As InDesign.Application
           Dim oFromDocument      As InDesign.Document
           Dim oToDocument        As InDesign.Document
           Dim oFromRectangle     As InDesign.Rectangle
           Dim oToRectangle       As InDesign.Rectangle


           Set moInDesign = CreateObject("InDesign.Application.CS6")
           Set oFromDocument = moInDesign.Documents.Add
           Set oFromRectangle = oFromDocument.Rectangles.Add
           oFromRectangle.GeometricBounds = Array(72, 72, 144, 144)


           Set oToDocument = moInDesign.Documents.Add
           Set oToRectangle = oFromRectangle.Duplicate(oToDocument.Pages.Item(1))