Hello, I'm trying to use VB macro to set Text Properties in CorelDraw. I can successfully read all of them, but I cannot set any. Any idea how to do it? Regards, Paul
Please, try the next way:
Dim sh As Shape
Set sh = ActiveShape
sh.Text.FontProperties.RangeKerning = 100
.WordSpacing = 200
.CharSpacing = 10
.LineSpacing = 150
Select a text box having two lines, try running the code line by line, pressing F8 (with VBE window small enough) and see what's happening
You can reset the characters spacing using the next code:
Dim tr As TextRange
If ActiveShape Is Nothing Then
MsgBox "Nothing selected", vbCritical
If ActiveShape.Type <> cdrTextShape Then
MsgBox "Make sure the a object is selected", vbCritical
If ActiveShape.Text.IsEditing Then
Set tr = ActiveShape.Text.Selection
MsgBox "Unable to reset Range Kerning for selection", vbExclamation
Set tr = ActiveShape.Text.Story
ActiveShape.Text.FontProperties.RangeKerning = 0
tr.WordSpacing = 100
tr.CharSpacing = 0
tr.LineSpacing = 100
Thank you for the suggestion, but its not the thing I was looking for. I need to change type of kerning schema, not the kerning spacing.
It seems that admin has reverted my initial post - the one that has been removed by anti spam bot. I will continue the discussion in the thread #64252
Can you explain what you mean by "kerning schema"? What else than spacing are you referring to?
I don't have English version of UI installed, so I don't know how exactly it is called in English. See the attached picture.
In all of the cases above spacing values are exactly the same.