OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-11-2008, 02:37
Joe Joe is offline
Member
 
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Post Joe's toolbox macro (in progress)

Hello! First post here.

Started trying to make my own VBA macros just yesterday to ease a specific task (importing a bunch of CAD drawings, resizing all of them by a percentage, etc) and have already snowballed out of control by making a crazy toolbox:



Yes, it's something only a father would love

Anyways, a question: I'd like to select a bunch of things on a page and then just press a button like "Top Left" to set the Alignment of Text (You can see this in the sort-of Joystick like thing next to the "Insert text" button). My code is such:

Code:
For Each Current In ActiveSelectionRange
     Current.Text.Frame.VerticalAlignment = cdrTopJustify
     Current.Text.Selection.Alignment = cdrLeftAlignment
Next Current
And it works ok as long as no non-text shapes are selected. What would be nice, though, would be to make it work on anything - if there is text, adjust, if it's a shape, ignore.

I realize some check is needed, but really can't find how to do it. This forum has already helped with the Alignment settings, hopefully this can be solved as well.

Thanks!

Edit: D'oh! With all this typed up I click "New posts" and bam! This one already has the necessary check visible:

Code:
For Each Current In ActiveSelectionRange
  If Current.Type = cdrTextShape Then
    Current.Text.Frame.VerticalAlignment = cdrTopJustify
    Current.Text.Selection.Alignment = cdrLeftAlignment
  End If
Next Current
Btw, is there a reliable code formatter/beautifier for VBA, preferably online?

Last edited by Joe; 06-11-2008 at 05:53.
Reply With Quote
 

Tags
text


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
Select All Text On a Layer knowbodynow CorelDRAW/Corel DESIGNER VBA 2 24-05-2007 20:08
Dimension presets affect line endpoint default corel designer whiner Feature requests/wishlist 0 28-06-2006 13:17
Select specified text, change font size? fiddler2b CorelDRAW/Corel DESIGNER VBA 3 23-04-2006 08:11
Select Paragraph Text with more than one color joexx CorelDRAW/Corel DESIGNER VBA 2 06-10-2004 12:20
Select All ddonnahoe CorelDRAW/Corel DESIGNER VBA 4 10-02-2004 09:14


All times are GMT -5. The time now is 17:34.


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