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 11-07-2008, 20:34
vindaa
Guest
 
Posts: n/a
Default Remove Mirror form All Selected Text

I have several Artistic Text rotated at different angle in a drawing. Now when I mirror the drawing the text is also mirrored. So how can I remove the mirror while preserving the new rotation angle (all the mirrored text is in different layer so selecting all the mirrored text at once would be easy)

Since I dont konw vb what I tried is

Sub RimoveMirror()

Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
RAng = OrigSelection.RotationAngle

Dim dup1 As ShapeRange
Set dup1 = OrigSelection.Duplicate()
dup1.ClearTransformations

dup1.RotationAngle = RAng
OrigSelection.Delete
End Sub

I thought that I will duplicate the selected text -- apply clear transformation to the duplicated text and ask it to copy rotation angle from the original selection and delete the original selection. But I am getting nowhere.
Reply With Quote
  #2  
Old 11-07-2008, 23:24
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Try this...

You almost have it and are on the right track...basically you need to.

1. Find all the text objects
2. Get their rotation angles
3. Mirror each piece of text back
4. Set the rotation angle back adjusting for the mirror*

*If you take a normal piece of text, horizontally mirror it look at the rotation angle it is 180 degrees. So when we set the angle back we have to adjust for this shift. Hope that make sense. Do you code might look something like this.
Code:
Sub FixText()
    Dim s As Shape
    Dim dblRotate As Double
    
    Optimization = True 'Stop the screen for redrawing (aka speed up the macro)
    
        For Each s In ActivePage.Shapes.FindShapes(Type:=cdrTextShape) 'Find all the text objects
            dblRotate = s.RotationAngle 'Get the angle of the shape
            s.Flip cdrFlipHorizontal 'Flip the shape back
            s.RotationAngle = dblRotate - 180 'Set the angle adjusting for the horizantal mirror shift
        Next s
    
    Optimization = False 'Turn screen redrawing back on
    ActiveWindow.Refresh 'Refresh the window
    Application.Refresh 'Refresh the Application
End Sub
Hope I got it right and it helps!

-Shelby
Reply With Quote
  #3  
Old 12-07-2008, 19:47
vindaa
Guest
 
Posts: n/a
Default

Hi Shelbym Thanks once again, This saves lot lot of time.
I just changed ActivePage to ActiveSelection. Since otherwise it mirrored the non mirrored text also.

Thanks a lot.
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
How selected a part of text TheFez CorelDRAW/Corel DESIGNER VBA 2 22-05-2008 07:07
Changing Selected text knowbodynow CorelDRAW/Corel DESIGNER VBA 2 17-10-2007 08:49
Remove Paragraph marks from artistic text knowbodynow CorelDRAW/Corel DESIGNER VBA 2 31-03-2006 18:48
corelDRAW paragraph text mirror "bug" hellraeser General 2 08-03-2006 23:17
Where is the selected text? petig CorelDRAW/Corel DESIGNER VBA 7 16-05-2005 15:30


All times are GMT -5. The time now is 19:45.


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