Hi. I'm trying to make a macro that will search a document and list all instances of transparency objects in each page.
Ive started with this code but I'm sure it's missing some things.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Private Sub CommandButton1_Click() Optimization = True ActiveDocument.BeginCommandGroup Dim sr As ShapeRange, s As Shape Set sr = ActivePage.FindShapes() If sr.count = 0 Then MsgBox "No Lens objects found." Exit Sub End If For Each s In sr If s.Transparency.Type <> cdrNoTransparency Then s.Transparency.ApplyNoTransparency Next ActiveDocument.EndCommandGroup Optimization = False End Sub
Are you wanting to remove transparencies from objects or just know how many objects with transparencies there are on each page of the document?
CorelDraw 2018 64bit. I'm trying to get a count of all lens objects per page of a document. From there, I can isolate and remove the lens property...if possible.
If none of these methods are working we must not be looking for what you want. Provide a simple .cdr example and we can take a look.
My code works in 2019 64 bit so should work in your version.
It adds all the transparencies to the second ShapeRange an selects them all at the end of the sub.
If you don't ant to remove the transparency from them all, you can comment out the line:
eff.Clear