6 Replies Latest reply: Mar 17, 2017 6:14 AM by Sasidhar Parupudi RSS
      • Re: How to add object to container with Grid layout via VBS
        Marcus Sommer

        This looks like your question:

         

        Set ContainerObj = ActiveDocument.Sheets("Main").CreateContainer

        set ContProp=ContainerObj.GetProperties

        ContProp.ContainedObjects.Add

        ContProp.SingleObjectMode=1

        ContProp.SingleObjectStyle=1

        ContProp.ShowObjectTypeIcons=true

        ContProp.ContainedObjects.Add

        ContProp.ContainedObjects.Item(0).Id = "Document\CH03"

        ContProp.ContainedObjects.Item(0).Text.v = "Bar"

        ContProp.ContainedObjects.Add

        ContProp.ContainedObjects.Item(1).Id = "Document\CH01"

        ContProp.ContainedObjects.Item(1).Text.v = "Mekko"

        ContainerObj.SetProperties ContProp

         

        - Marcus

        • Re: How to add object to container with Grid layout via VBS
          Sasidhar Parupudi

          Sub Export

               Chart1="Document\CH04"

               Chart2="Document\CH02"

               TargetFile="c:\aps\Container.png"

               Call ExportContainer(Chart1,Chart2,TargetFile)

          End Sub

           

           

          Sub ExportContainer(Chart1,Chart2,TargetFile)

              set ContainerObj = ActiveDocument.Sheets("Main").CreateContainer

              set ContProp=ContainerObj.GetProperties

              ContProp.ContainedObjects.Add

              ContProp.Mode=1

              ContProp.GridColumns=2

              ContProp.GridRows=1

              ContProp.ShowObjectTypeIcons=true

              ContProp.ContainedObjects.Add

              ContProp.ContainedObjects.Item(0).Def.ObjectId = Chart1

              ContProp.ContainedObjects.Item(0).Text.v =Chart1

              ContProp.ContainedObjects.Add

              ContProp.ContainedObjects.Item(1).Def.ObjectId =Chart1

              ContProp.ContainedObjects.Item(1).Text.v = Chart1

              ContainerObj.SetProperties ContProp

              ActiveDocument.GetApplication.WaitForIdle

              ContainerObj.ExportBitmapToFile TargetFile

              ContainerObj.Close

          End Sub