![]() |
|
#1
|
|||
|
|||
![]()
Hello,
Is the following code OK? I'm trying to create a duplicate that aligns to another object. Code:
Sub duptoVposition() Dim s1 As Shape Dim y1 As Double, y2 As Double Dim setrevoffset As String ActiveDocument.Unit = cdrMillimeter If ActiveDocument Is Nothing Then End If ActiveSelection.Shapes.Count = 2 Then y1 = ActiveSelection.Shapes(1).PositionY y2 = ActiveSelection.Shapes(2).PositionY setrevoffset = y2 - y1 Set s1 = ActiveSelection.Shapes(1).Duplicate(, setrevoffset) s1.CreateSelection End If End Sub Thanks, Chris (Hunt) |
#2
|
||||
|
||||
![]()
your code is working ok here.
I guess the problem might be in Page XY Origin location. Is it default left bottom corner? |
#3
|
|||
|
|||
![]()
Hi I'm new, both to this forum and to VBA. So bear with me if I ask rookie (stupid) questions.
1. The macro works for me. It aligns to the top of the "anchor" object 2. Now the questions: why is "setrevoffset" set As String instead of Double? is the top a default reference point since none was specified? |
#4
|
||||
|
||||
![]()
1. it works this way too but slower :-) declare as double is of course would be more logical :-)
2. I dunno frankly what can be the cause of malfunction, so that was just a desperate guess |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Selected object to other page Duplicate method ? | ljesus7 | CorelDRAW/Corel DESIGNER VBA | 5 | 12-02-2007 16:37 |
Querious Problem. | amollondhe | CorelDRAW/Corel DESIGNER VBA | 1 | 31-03-2006 08:40 |
CD11 Convert to Bitmap -> CMYK to Gray scale problem | xenio | General | 7 | 24-07-2005 21:46 |
a problem... | CorelUser | General | 2 | 20-06-2004 02:21 |
Problem with Export (or Save as) in AI-Format | LOT | CorelDRAW/Corel DESIGNER VBA | 3 | 10-02-2004 14:28 |