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 07-03-2006, 09:04
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default Checking fill type

I'd like a macro to set the the outline colour to be the same as the fill colour. The following is straight from the CorelDraw VBA guide:

Sub setoutline()
Dim sh As Shape
Set sh = ActiveShape
sh.Outline.Color.CopyAssign sh.Fill.UniformColor
End Sub

The problem is that if the fill isn't uniform, for example a fountain fill then an error is returned. I've been trying to figure out a way to find out the type of fill without success. Is there a way to check what kind of fill a shape has?

Thanks,

Chris (Hunt)
Reply With Quote
  #2  
Old 07-03-2006, 10:02
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Of course there is. Just check the Fill.Type property. Here is an example:

Code:
Sub setoutline()
    Dim sh As Shape
    Set sh = ActiveShape
    If sh.Fill.Type = cdrUniformFill Then
        sh.Outline.Color.CopyAssign sh.Fill.UniformColor
    End If
End Sub
P.S. You can include your code in the {code} tags to appear as distinctive code snippet (just like this one above). Put it like:

{code}Sub ...
...
End Sub{/code}

just use [] instead of {} above. Or just paste your code in your post, select the code text and click the "#" button above this text window and the CODE tags will be added automatically...

I think it helps read the code better as the text is formatted better.
Reply With Quote
  #3  
Old 08-03-2006, 02:18
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Thanks Alex, it's back to the manual for me - I was trying to use "UniformFill" rather than "cdrUniformFill".

I'll remember what you said about posting code, I agree it's much easier to follow.

Best wishes,

Chris
Reply With Quote
Reply


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
Fountain Fill to follow the shape of an object Alex FAQ 3 10-05-2007 00:33
Fountain Fill changes when object is rotated Alex FAQ 1 03-05-2005 22:35
object lost it's linear fountain fill property after metalickaah CorelDRAW/Corel DESIGNER VBA 5 02-01-2005 22:36
Try to capture a fill color for reuse Anonymous CorelDRAW CS 1 03-05-2004 20:48
fill type jwknight CorelDRAW/Corel DESIGNER VBA 1 04-03-2004 13:47


All times are GMT -5. The time now is 10:34.


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