![]() |
#1
|
|||
|
|||
![]()
I would like to create ArtisticText and have it aligned in shape2 however no matter what I try it does not work. I am new to Corel but use scripting in my dayjob. Any help would be great! Below is the code that I currently have to create 2 shapes and create the text.
Code:
Set objCorelDraw = CreateObject("CorelDRAW.Application.15") objCorelDraw.Visible = True Set d = objCorelDraw.CreateDocument With d.ActivePage .Orientation = cdrLandscape .SizeWidth = 3 .SizeHeight = 3 .PrintExportBackground = False .Background = cdrPageBackgroundNone End With Set shape1 = d.ActiveLayer.CreateRectangle2(0, 0, 3, 3, 0.3375, 0.3375, 0.3375, 0.3375) d.ActiveShape.Outline.Width = 0.003 d.ActiveShape.Outline.Color.RGBAssign 255, 0, 0 Set shape2 = d.ActiveLayer.CreateRectangle2(0, 0, 3, 3, 0.3375, 0.3375, 0.3375, 0.3375) d.ActiveShape.Outline.Width = 0.025 d.ActiveShape.Outline.Color.RGBAssign 0, 255, 0 Set txt = d.ActiveLayer.CreateArtisticText(0, 0, "Hello World", , , "Arial Black", 24) Set txt = shape2.PlaceTextInside(txt) |
#3
|
|||
|
|||
![]()
Thanks for your reply. I just tried it and the text is located at 0,0 and is set to the left. The only item that may be different than most is that I am running this script as .VBS script from my desktop. I am attaching a screenshot of the results.
|
#4
|
||||
|
||||
![]()
Hi.
I tested this earlier with Shelby's add and it worked great. The only modification to it was declaring the variables shape1, shape2, and txt as shapes. -John |
#5
|
|||
|
|||
![]()
Thanks for your review. I think the problem is that .VBS script cannot declared as a shape. I have seen other threads on this but not a clear cut solution. If you have any suggestions, I'm all ears. Again, thanks for your guys help.
|
#7
|
|||
|
|||
![]()
I could try it - Worse case is I convert it over to a small VB.NET application. I really appreciate all of your help in this. I will try it out this weekend and will let you know.
|
#8
|
|||
|
|||
![]()
Thanks for all of your help - I was able to resolve the issue and have the file run from the desktop as a vbs. The issue was that .VBS did not know how to handle the line cdrAlignVCenter or cdrAlignHCenter. I changed these to their values and it worked like a champ. I found these values at: http://www.grafxdosgueros.com/vba/dr...AlignType.html.
The updated code is below: VBA Code:
txt.AlignToShape cdrAlignHCenter + cdrAlignVCenter, shape1 Code:
txt.AlignToShape 3 + 12, shape1 |
![]() |
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 |
How to select the same ArtisticText | engandy | CorelDRAW/Corel DESIGNER VBA | 5 | 08-10-2008 03:59 |
scaling objects and alignment | eldwin | CorelDRAW/Corel DESIGNER VBA | 4 | 01-03-2008 10:53 |
How do I reference ArtisticText objects? "Shape Index o | andyb | CorelDRAW/Corel DESIGNER VBA | 1 | 10-07-2003 15:59 |
how can i get coreldraw artistic text alignment | batman| | CorelDRAW/Corel DESIGNER VBA | 6 | 17-01-2003 05:43 |
artistic text alignment | batman| | CorelDRAW CS | 0 | 04-01-2003 05:39 |