View Single Post
  #1  
Old 09-07-2015, 17:35
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default Set Transparency using a variable

Im after writing a macro that will allow me to set the level of transparency on a set of individual shapes and would like to be able to set a variable and then use a line that says; "s.setTransparency = x" but recording the macro produced this very long line;

Code:
Sub setT()
    '     changes selected transparent objects level of transparency to 74
    Dim OrigSelection As ShapeRange
    Set OrigSelection = ActiveSelectionRange
    OrigSelection(1).Style.StringAssign "{""transparency"":{""uniformTransparency"":""0.73999999999999999"",""fill"":{""type"":""1""}},""fill"":{""type"":""1"",""overprint"":""0"",""primaryColor"":""RGB255,USER,255,0,0,100,8273965b-a0fd-4e34-a5c2-a29720146cc3"",""secondaryColor"":""CMYK,USER,0,0,0,0,100,00000000-0000-0000-0000-000000000000""},""outline"":{""color"":""CMYK,USER,0,0,0,100,100,00000000-0000-0000-0000-000000000000"",""width"":""2000""}}"
End Sub
I want to replace the
Code:
:""0.73999999999999999"",
with :x, but the syntax has proved unguessable to me and I suspect I will also need to feed in other info - the colour and line width info. Would somebody point me in the right direction or throw some light on how to do this.
Thanks
nic

CDX6 Win 64
Reply With Quote