Im struggling with series of macros and one part of the whole chain has to be: select Object (shapes)"One" and "Two", then combine. Objects are already renamed but can't figure out how to select them by their names.
Can someone help me?Thank you very much.
I finded a simple macro which find one object by name, but I need to select two objects.
Sub Test01() Dim s As Shape Set s = ActivePage.FindShape("One") If Not s Is Nothing Then s.CreateSelection Else ActiveDocument.ClearSelection End IfEnd Sub
Dim sr As New ShapeRange
Dim sOne As Shape
Dim sTwo As Shape
Set sOne = ActivePage.Shapes.FindShape("One")
Set sTwo = ActivePage.Shapes.FindShape("Two")
If Not sOne Is Nothing And Not sTwo Is Nothing Then
Eskimo Thank you good sir, I owe you one :)
I have two new problems, if you can help me, it would be nice.
1st Is possible to run chain of separated (recorded) macros? They have names: Macro1, Macro2, Macro3, ETC.
2nd How the hell I create marco for exporting PNG (transparent background) from CDR, any idea?
I think that recording macros can sometimes help to learn some things about how CorelDRAW works.
However, recording has serious limitations. A lot of actions that can be performed in CorelDRAW cannot be recorded. When it does record things, it may produce code that is very different from code you might write "by hand" to do the same job.
The more you learn about writing VBA for CorelDRAW, the more you can do with it.
One place to start is the Developer Area; a number of resources there.
You might also have a look at some of the content provided by Sub GDG_John( ) - GDG Macros VBA Lessons; lots of good stuff there.
Atrey said:2nd How the hell I create marco for exporting PNG (transparent background) from CDR, any idea?
You may be using one of these methods:
Sometimes there is more than one way to do something because one way is an "older" way, and another way is a "newer" way.
I wrote a macro that can export .PNG and .JPG, and I use Document.ExportEx in that.