OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old 07-11-2012, 12:13
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Is is a different size from the other jpg and is it always the same size on all pages?

We can also get easily if it's in the exact same position on every page.

~John
Reply With Quote
  #12  
Old 07-11-2012, 12:54
juran juran is offline
Member
 
Join Date: Oct 2012
Posts: 35
Default

Yes, its different in size. But..... each image in each page slightly vary in size.
To get similarity in image size, Can we try the autopowerclip and then try to move the image as you said..

Again autopowerclip should happen to all images in all pages simultaneously.

What about Order Front of page. ?? Hope I'm not confusing you..

Last edited by juran; 07-11-2012 at 13:06.
Reply With Quote
  #13  
Old 07-11-2012, 18:20
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
This code will select the top most shape on all pages at a x,y point you specify and move it right by .25 of an inch.
I think this will work for you. You only need find x,y and tell it how much you want to move it.

Code:
Private Function findShapeAndMove()
    Dim s As Shape, sSel As Shape, p As Page
    Dim x#, y#
    'find at this point
    x = 3
    y = 5
    
    For Each p In ActiveDocument.Pages
        p.Activate
        Set sSel = ActivePage.SelectShapesAtPoint(x, y, True, 0.01)
        If sSel.Shapes.count > 0 Then
            Set s = sSel.Shapes.Last
            s.Move 0.25, 0
        End If
    Next p
~John
Reply With Quote
  #14  
Old 08-11-2012, 01:22
juran juran is offline
Member
 
Join Date: Oct 2012
Posts: 35
Default 1 shape all pages

I tried to alter this following code with the help of your code..
I'm unable to do. Instead of "all shapes", I want only 1 shape which is in (front order) to move.

Could u try this for me ?

Code:
    'This procedure selects all shapes on all pages including the Master page.
     'It allows you to move them a specified distance.
     'It will ask if you wanted the shapes on the Mastepage moved.
     'If you did not then it moves the Master page shapes back.
     'This is easier than to select all shapes less the Master page shapes.

     'If you write a procedure to select all shapes on all pages.
     'Do not attempt to move the shapes using the mouse.
     'If you do, all the shapes, on all pages, will move to the active page.

     Dim ALL_SHAPES As ShapeRange
          
     Dim intPAGE_No As Integer
     Dim IntNo_Pages As Integer
     Dim strINPUTBOX_VALUE As String
     Dim sngX_POSITION As Single
     Dim sngY_POSITION As Single

     'Select All Shapes on All Pages.
     IntNo_Pages = ActiveDocument.Pages.Count
     Set ALL_SHAPES = ActiveDocument.Pages(1).shapes.All
        
     intPAGE_No = 2
     While intPAGE_No <= IntNo_Pages
               
          ALL_SHAPES.AddRange ActiveDocument.Pages(intPAGE_No).shapes.All
          
          intPAGE_No = intPAGE_No + 1
     Wend

     'Enter the horiziontal displacement.
     'If there is no input value then do not move across.
     strINPUTBOX_VALUE = InputBox("How many millimeters to the right?" & vbCr & "Negatives are OK.", _
       "Horizontal Displacement of All Objects!")
     If strINPUTBOX_VALUE = "" Then
          sngX_POSITION = 0
          Else
          'Convert string to single.
          sngX_POSITION = CSng(strINPUTBOX_VALUE)
     End If

     'Enter the vertical displacement.
     strINPUTBOX_VALUE = InputBox("How many millimeters up?" & vbCr & "Negatives are OK.", _
        "Vertical Displacement of All Objects!")
     'If there is no input value then do not move up.
     If strINPUTBOX_VALUE = "" Then
          sngY_POSITION = 0
          Else
          'Convert string to single.
          sngY_POSITION = CSng(strINPUTBOX_VALUE)
     End If

     'Measuremments are in inches so convert to millimeters and move all the objects.
     ALL_SHAPES.Move sngX_POSITION / 25.4, sngY_POSITION / 25.4

        Set ALL_SHAPES = Nothing
     
     'Ask if the Master Shapes were to be moved. If not move them back.
     If MsgBox("Move Master Shapes as well?", vbYesNo, "") = vbNo Then
          'Now select all the Master Shapes and return them to thir original position.
          Set ALL_SHAPES = ActiveDocument.MasterPage.shapes.All
          'Measuremments are in inches so convert to millimeters and move all the objects.
          ALL_SHAPES.Move -1 * sngX_POSITION / 25.4, -1 * sngY_POSITION / 25.4

          Set ALL_SHAPES = Nothing
     End If
End Sub

Last edited by juran; 09-11-2012 at 04:11.
Reply With Quote
  #15  
Old 09-11-2012, 04:10
juran juran is offline
Member
 
Join Date: Oct 2012
Posts: 35
Default shapes

I'm still with this..
Any solution ? Please...
Reply With Quote
  #16  
Old 10-11-2012, 06:29
juran juran is offline
Member
 
Join Date: Oct 2012
Posts: 35
Default

Extremely Sorry to put too many queries often... Hopefully this would be my last try...

This code moves the "original selection" pic to (up, down, right, left)
How to make it do in all pages for a particular character image ?

Active selection / Order Front of page - Can this be a characteristic of an image to do the work in all pages simultaneously ??

Quote:
Private Sub down_Click()
Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
OrigSelection.move 0, -0.1
End Sub

Private Sub left_Click()
Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
OrigSelection.move -0.1, 0
End Sub

Private Sub right_Click()
Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
OrigSelection.move 0.1, 0
End Sub

Private Sub up_Click()
Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
OrigSelection.move 0, 0.1
End Sub

Finally... I'm so grateful and thankful to you both shelbym & runflacruiser for being so supportive !!
Attached Images
 
Reply With Quote
  #17  
Old 11-11-2012, 17:28
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Basically it's simple as we said before but we need to distinguish each shape on the pages via certain characteristics in order to work with it. We can distinguish via it's size, if same on all pages, it's position, if same, etc.

I still don't think you understand this. I will be happy to help though. Can you attach or send a cdr file with a few of the pages and let me know which item needs moved. Then I can take a look for myself and find the common characteristic which can be used to find and work with the shape on each page.

~John
Reply With Quote
  #18  
Old 12-11-2012, 05:31
juran juran is offline
Member
 
Join Date: Oct 2012
Posts: 35
Default

I've attached the cdr as well the code file for your perusal.

Thank you again for your kindness
Attached Files
File Type: zip child_log.zip (516.9 KB, 192 views)

Last edited by juran; 12-11-2012 at 05:39.
Reply With Quote
  #19  
Old 12-11-2012, 08:30
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Here's 2 ways. Both move the pink square shape over by 25 mm.

Code:
Private Function findShapeAndMove1()
    Dim s As Shape, sSel As Shape, p As Page, s1 As Shape
    Dim x#, y#, dSize#, iStatic&

    ActiveDocument.Unit = cdrMillimeter
    
    x = 77
    y = 26
    dSize = 36.5
    For Each p In ActiveDocument.Pages
        p.Activate
        Set sSel = ActivePage.SelectShapesAtPoint(x, y, True, 0.01)
        If sSel.Shapes.count > 0 Then
            For Each s1 In sSel.Shapes.All
                If dSize = Round(s1.SizeHeight, 1) Then
                    iStatic = s1.StaticID
                End If
            Next s1
            Set s = ActivePage.Shapes.FindShape(Query:="@Com.StaticId = " & iStatic)
            If Not s Is Nothing Then s.Move 25, 0
        End If
    Next p
End Function

Private Function findShapeAndMove2()
    Dim s As Shape, i&

    For i = 1 To ActiveDocument.Pages.count
        Set s = ActiveDocument.Pages(i).Shapes.FindShape(Query:="@height.round(1) = {36.5 mm}")
        s.Move 25, 0
    Next i

End Function
~John
Reply With Quote
  #20  
Old 12-11-2012, 11:54
juran juran is offline
Member
 
Join Date: Oct 2012
Posts: 35
Default

Thank you sir..
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
Extract object from the group dear CorelDRAW/Corel DESIGNER VBA 9 05-02-2009 11:03
Find Group ungroup it then process and again group derasje Macros/Add-ons 2 19-11-2008 04:04
Colour swatches from existing document? Gadget CorelDRAW/Corel DESIGNER VBA 2 21-02-2008 03:19
Bug with existing selection m31uk3 Code Critique 1 02-01-2008 18:18
Suggestion - palette from existing drawing Webster CorelDRAW/Corel DESIGNER VBA 3 22-10-2004 03:18


All times are GMT -5. The time now is 06:39.


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