A few issues I've encountered.

This is my first post so Hello to everyone who frequents these forums!

Special shout outs GDG John, Shelby and Jeff; You guys have literally taught me how to code. I now work full time on developing macros at the sign company where I work. I've been a voyeur of oberon place and these forums and reading your responses and blogs has been my main source of information/training. So thank you.

I use X7 with all the latest updates and write all my code in VBA.

Now I've got two quick issues/questions related to Corel vba that I've been unable to find work arounds for:

1. Getting font size with text.frame.range cannot go over 600! I've got a public function I use to find the reference text on a document so all text generated through VBA is standardised to the same font size. The problem is once the referenced objects fontsize goes over 600 It starts to do all sorts of strange things with the text size and position.

I assume this is something to do with the limits of the single data type (?) and thought I could avoid this issue by temporarily changing the font units from Pt to larger unit (inches) but have not been able to work this out. Code Example below:


Dim ss As ShapeRange, ss2 As TEXTRANGE
Dim FONTSIZE As single
Set ss = ActiveSpread.Shapes.FindShapes("jobno")

If ss(1) Is Nothing Then FONTSIZE = 150:GoTo NoDescription

Set ss2 = ss(1).text.Frame.Range
FONTSIZE = ss2.Size
If FONTSIZE > 600 Then FONTSIZE = 600



2. String = Shape.name string length restriction. I use names of objects to generate labels for our through-section macro. 65 Characters seems to be the limit on strings pulled in this way. While this is fine for most components there are some that are longer. Short of creating some sort of short hand then finding the replacing the substrings (i.e Ali changed to Aluminium), which would snarl up the macro to no ends and create a lot more work. I assume this is just a Limitation with Corel Draw so all suggestions and ideas welcome. Example below:


Sub NameTest()
Dim NameSr$, AcName$
Dim Sh1 As Shape, Tx1 As Shape
Set Sh1 = ActiveShape
NameSr = String(200, "X")
Sh1.Name = NameSr
AcName = Sh1.Name
Set Tx1 = ActiveLayer.CreateArtisticText(Sh1.CenterX, Sh1.CenterY, AcName)
End Sub