I am creating a macro in Excel that creates labels with text that should be centered. s1 is already defined as a rectangle earlier in the script. I keep getting an error that cdrCenterJustify in not defined. How do I send this argument to CorelDraw within the script in excel?
The code in excel is written as follows:
Set s2 = CorelApp.ActiveLayer.CreateArtisticText(-7.75, (1 - 0.5) / 2, test) Set Txt = s2.Text Txt.Story.Font = "Swis721 BT" Txt.Story.Size = 20 Txt.Story.LineSpacing = 75 Txt.Frame.VerticalAlignment = cdrCenterJustify s2.Fill.UniformColor.CMYKAssign 0, 0, 0, 100 s2.Outline.SetNoOutline s2.CenterX = s1.CenterX s2.CenterY = s1.CenterY
I experience a similar problem when I create a new page
Set createopt = CorelApp.CreateStructCreateOptions With createopt .Name = "Legend Plates" .Units = cdrInch .PageWidth = 24# .PageHeight = 12# .Resolution = 300# End With
These are the correct arguments to use in a script within CorelDraw but clearly these arguments do not exist in Excel. I have tried simply sending them as a string but I get a different error: "type mismatch". Is there a way to send these arguments to CorelDraw within Excel?