OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 10-07-2015, 10:23
shark shark is offline
Senior Member
 
Join Date: Aug 2010
Location: Russia, Belgorod
Posts: 145
Default

you could use each single shape in For-Each loop and change value of Transparency by using s.Transparency.Uniform = 74
Reply With Quote
  #3  
Old 11-07-2015, 07:15
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default perfect

Thanks Shark - that works perfectly.
Reply With Quote
Reply

Tags
transparency


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Variable be assigned to CQL Query aakkaarr CorelDRAW/Corel DESIGNER VBA 5 18-04-2012 18:16
Object variable or with block variable not set.. m31uk3 Code Critique 2 26-12-2007 14:17
background transparency leopardo General 2 05-12-2005 09:10
Transparency Problem. freerangequark General 2 01-06-2005 16:13
Icon’s Transparency Hernán CorelDRAW/Corel DESIGNER VBA 0 29-07-2003 20:04


All times are GMT -5. The time now is 21:49.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com