OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 28-04-2010, 19:25
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Sorry about that...Try it now.
-John
Reply With Quote
  #22  
Old 29-04-2010, 14:52
gorgo2 gorgo2 is offline
Senior Member
 
Join Date: Feb 2010
Posts: 107
Default

Quote:
Originally Posted by runflacruiser View Post
Hi.
Try this:

Code:
Option Explicit

Sub moveToPage()

Dim s As Shape, sr2 As New ShapeRange
Dim i As Integer, j As Integer
Dim x As Double, y As Double, w As Double, h As Double
Dim docY As Double, docX As Double
Dim moveIt As Boolean
Dim ref As cdrReferencePoint


docY = ActivePage.SizeHeight
docX = ActivePage.SizeWidth



For j = 1 To 9
    For i = 1 To ActivePage.Shapes.Count
        moveIt = False
        ActiveDocument.ReferencePoint = myRef(j)
        Set s = ActivePage.Shapes(i)
        s.GetPosition x, y
        If (s.PositionX < 0 Or s.PositionX > docX) Or (s.PositionY < 0 Or s.PositionY > docY) Then
            moveIt = True
        End If
        
        If moveIt = True Then 'move to layer or do something
            's.MoveToLayer "Desktop" 'move it to your layer
            sr2.Add s
            's.Fill.ApplyUniformFill CreateCMYKColor(100, 0, 0, 0) 'for testing
        End If
    Next i
Next j

If sr2.Count > 0 Then
    sr2.Delete
End If

End Sub

Private Function myRef(i As Integer) As cdrReferencePoint
    
    Select Case i
            Case 1
                myRef = cdrBottomLeft
            Case 2
                myRef = cdrBottomMiddle
            Case 3
                myRef = cdrBottomRight
            Case 4
                myRef = cdrCenter
            Case 5
                myRef = cdrMiddleLeft
            Case 6
                myRef = cdrMiddleRight
            Case 7
                myRef = cdrTopLeft
            Case 8
                myRef = cdrTopMiddle
            Case 9
                myRef = cdrTopRight
    End Select

End Function
-John
I think I like this version...however, on certain documents for some reason some of the objects on the page are also deleted. I have no clue why this happens and it seems intermittent...hmmm.
Reply With Quote
  #23  
Old 29-04-2010, 15:20
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Did you try Shelby's version on the same page?

-John
Reply With Quote
  #24  
Old 30-04-2010, 10:29
gorgo2 gorgo2 is offline
Senior Member
 
Join Date: Feb 2010
Posts: 107
Default

Quote:
Originally Posted by runflacruiser View Post
Hi.
This one may do what you need. It's free and open source code. It already has a form and you can modify as needed.

-John
I have the form and I'd like to modify it. However how would I add code that will detect the currently open document and insert the file name as I save as?
Attached Images
 
Reply With Quote
  #25  
Old 30-04-2010, 11:19
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
You can put:

Code:
If ActiveDocument.FileName <> "" Then
    TextBox1.Value = ActiveDocument.FileName
End If
somewhere in the form code userform_initialize sub

-John
Reply With Quote
  #26  
Old 30-04-2010, 13:46
gorgo2 gorgo2 is offline
Senior Member
 
Join Date: Feb 2010
Posts: 107
Default

Quote:
Originally Posted by runflacruiser View Post
Hi.
Did you try Shelby's version on the same page?

-John
Okay, works better with Shelby's code. Will keep testing. Thanks all!
Reply With Quote
  #27  
Old 30-04-2010, 21:17
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Default

Quote:
Originally Posted by runflacruiser View Post
Hi.
You can put:

Code:
If ActiveDocument.FileName <> "" Then
    TextBox1.Value = ActiveDocument.FileName
End If
somewhere in the form code userform_initialize sub

-John
SUCCESS!
Reply With Quote
  #28  
Old 30-04-2010, 22:57
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Cool!
I love to help.

Is that the one you got from my site. If so I posted the wrong one. Glad it works for ya though.

-John
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
Opening document with disabling macros clausm CorelDRAW/Corel DESIGNER VBA 2 09-04-2010 15:06
New X4 Custom Dockers bprice CorelDRAW/Corel DESIGNER VBA 4 21-07-2008 11:11
Custom Palettes? masterchiefph CorelDRAW/Corel DESIGNER VBA 2 23-07-2007 19:41
Custom Palettes via VBA ddonnahoe CorelDRAW/Corel DESIGNER VBA 7 13-11-2006 07:53
Add Custom Buttons.. drg CorelDRAW/Corel DESIGNER VBA 6 17-09-2004 06:36


All times are GMT -5. The time now is 02:56.


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