Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have some n charts inside a container, I want to delete them by looping through all objects in the container.
Can someone tell me how to do this using a macro.
Thanks,
Jyotsna
Got it finally
Set ContainerObj = ActiveDocument.GetSheetObject("CT01")
Set ContProp = ContainerObj.GetProperties
for i=0 to ContProp.ContainedObjects.Count-1
ContProp.ContainedObjets.RemoveAt(0)
ContainerObj.SetProperties ContProp
next
Hope this helps someone
Hi,
Try like this not sure it works.
Set ContainerObj = ActiveDocument.Sheets("Main").CreateContainer
set ContProp=ContainerObj.GetProperties
ContProp.ContainedObjects.Item(0).Remove
or
ContProp.ContainedObjects.Item(0).Delete
Regards,
Jagan.
I tried all of Remove, Delete and Close, nothing seems to be working.
Thanks,
Jyotsna
Got it finally
Set ContainerObj = ActiveDocument.GetSheetObject("CT01")
Set ContProp = ContainerObj.GetProperties
for i=0 to ContProp.ContainedObjects.Count-1
ContProp.ContainedObjets.RemoveAt(0)
ContainerObj.SetProperties ContProp
next
Hope this helps someone
Great. Not given this in APIGuide.
Regards,
Jagan.