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 17-11-2004, 00:25
fremoikaner
Guest
 
Posts: n/a
Default VBA help needed - changing colours

Hi there!

Please be patient with me - this is the first time I'm using a
newsgroup. And my english is a little bit rusty - I'm from germany.

I have documents with drawings and want to have them transfered to other
layers and partially replace there the colors. This is necesaary for
printing this documents on an alps printer which can print all colours
and white, silver and gold. A usual color seperation is not working
correctly so I need different layers. The layers are named "Glanz" for
the finishing, "Weiss" for white, "bunt" for all colours, "silber" for
silver and "gold" for ... right gold ;-)

I'm trying to write a VBA that does the following things:
All objects are drawn on the layer "Glanz".


1. Copy all objects from layer "Glanz" to layer "Weiss"
2. Disable layer "Glanz"
3. Select all objects on layer "Weiss" (one after the other)
3a. If an object has outline-color "black" - change outline-color to "white"
3b. If an object has fill-color "black" - change fill-color to "white".
4. Disable layer "Weiss"

5. Enable layer "Glanz"
6. Copy all objects from layer "Glanz" to layer "bunt"
6a. Disable layer "Glanz"
7. Select all objects on layer "bunt" (one after the other)
7a. If an object has outline-color "10% black" or "30% black" or "gold"
- change outline-color to "white"
7b. If an object has fill-color "10% black" or "30% black" or "gold" -
change fill-color to "white".
8. Disable layer "bunt"

9. Enable layer "Glanz"
10. Copy all objects from layer "Glanz" to layer "silber"
10a. Disable layer "Glanz"
11. Select all objects on layer "silber" (one after the other)
11a. If an object has outline-color <> "30% black" - change
outline-color to "white" else change outline-color to "black"
11b. If an object has fill-color <> "30% black" - change fill-color to
"white" else change fill-color to "black"
12. Disable layer "silber"

13. Enable layer "Glanz"
14. Copy all objects from layer "Glanz" to layer "gold"
14a. Disable layer "Glanz"
15. Select all objects on layer "gold" (one after the other)
15a. If an object has outline-color <> "gold" - change outline-color to
"white" else change outline-color to "black"
15b. If an object has fill-color <> "gold" - change fill-color to
"white" else change fill-color to "black"
16. Disable layer "gold"


This is what I recorded in CorelScript and than transfered to VBA:

With CreateObject("CorelDraw.Automation.9")
.StartOfRecording
.SuppressPainting True
.SelectLayer "Glanz"
.SelectAllObjects
.RecorderSelectObjectsByIndex True, 1, -1, -1, -1, -1
.CopyToLayer "Bunt"
.UnSelectAll
.SetLayerVisible False, "Bunt", 0
.SelectAllObjects
.RecorderSelectObjectsByIndex True, 1, -1, -1, -1, -1
.CopyToLayer "Weiss"
.ResumePainting
.EndOfRecording
End With
End Sub


This VBA-code I found on www.oberonplace.com:

Sub Fillallwithred()
Dim s As Shape
For Each s In ActiveDocument.ActivePage.Shapes
s.Fill.UniformColor.RGBAssign 255,0,0
Next s
End Sub


This might be a part of the possible solution.
But I'm not able to combine this two parts together.

This is why I'm asking for your help on this sunny sunday :-)

Thanks a lot in advance
and a lot of greetings from germany

fremoikaner
Reply With Quote
  #2  
Old 18-11-2004, 06:06
Seelenquell
Guest
 
Posts: n/a
Default

hey,

ich gugg mir das mal an und antworte in den nächsten tagen.
i will be looking for the "problem" and then answer in the next few days

grüße aus germany nach germany.
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
delete vba project from cdr file hotairballoon CorelDRAW/Corel DESIGNER VBA 1 18-05-2005 09:08
CD 10, VBA not returning true outline width Webster CorelDRAW/Corel DESIGNER VBA 1 24-11-2004 17:09
VBA does not work with my CD 10 ! jobar CorelDRAW/Corel DESIGNER VBA 1 24-08-2003 12:38
Detect if VBA is installed (an answer and a question) reanan CorelDRAW/Corel DESIGNER VBA 3 04-12-2002 14:35
CorelDraw 11 VBA DOM? sdickson CorelDRAW/Corel DESIGNER VBA 2 03-12-2002 15:05


All times are GMT -5. The time now is 20:29.


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