SCRIPTING MACROS IN COREL DRAW // TEXT OBJECT != STRING !?

Hello everyone, first of all thank you for taking the time to read my post. 

I would like to ask why corel draw treats text items (Story) found in text shapes as a  "Text" class and not as a string? I am asking because i need to scan the text item for certain character ":" and i only know how to do this by treating text as strings and using the methods that belong to it. Thanks for any help!

  • Maybe this will help.

    Sub CharacterToSuperscript2()

       Dim p As Page, s As Shape, t As TextRange, sr As ShapeRange

       Dim i&, myReplaceFont$, myCharacterToFind$, j&

       myCharacterToFind = "©" 'changes this character to superscript

       myReplaceFont = "Arial" 'changes character to this font

       j = ActiveDocument.ActivePage.Index

       For Each p In ActiveDocument.Pages

           p.Activate

           Set sr = ActivePage.Shapes.FindShapes(, cdrTextShape)

               For Each s In sr

                   For i = 1 To s.Text.Story.Characters.Count

                       Set t = s.Text.Story.Characters(i)

                       If t = myCharacterToFind Then s.Text.FontPropertiesInRange(i, 1).Position = cdrSuperscriptFontPosition

                   Next i

           Next s

       Next p

       ActiveDocument.Pages(j).Activate

    End Sub

  • Former Member
    0 Former Member over 7 years ago
    more or less...
    Strings no have color, style, font, height, etc, strings are char collection in memory, to render one string in display using gdi+ for exemple, you also need font, brush, position, etc. Text object encapsulating many others object types.You can acess the string of the text object with the propertie "Contents".