VBA Code to Move Text Node via Shape Tool

 We need to write VBA code that will select and slightly move the node of one character in a CorelDraw X7 heading text inscription via the Shape Tool (Note: not the same as "RangeKerning" or "Move"). Any suggestions?

  • I am not sure which node you are trying to move. Could you post a simple image of what you are trying to do and we will see if we can help.

    -Shelby
    • Thank you for the picture, that makes it much easier to understand. You will need to use the VertShift and HorizShift. One note about these values is that they are in %.

      You can see the value on the properties bar:

      Here are a few code examples:

      Sub MoveCharacter()
          'Move the first character using a Range
          ActiveShape.Text.Story.Range(0, 1).VertShift = 50
          ActiveShape.Text.Story.Range(0, 1).HorizShift = -22
          
          'Move the second character
          ActiveShape.Text.Story.Characters(2).VertShift = -50
          ActiveShape.Text.Story.Characters(2).HorizShift = -22
          
          'Change the angle of the third character
          ActiveShape.Text.Story.Characters(3).CharAngle = 25
          
          'Verticle shift the entire second word
          ActiveShape.Text.Story.Words(2).VertShift = 25
      End Sub
      

      And here is what the before and after would look like:

      Hope that helps,

      -Shelby

      • Thank you for your response and recommendation.

        We realize that several approaches can be used to move a single character in a CorelDraw X7 heading text inscription—including "HorizShift", "VertShift", "RangeKerning", and "Move". Technically, however, moving one character with any of these approaches is not the same—under the hood of CorelDraw X7—as selecting and slightly moving its node with the Shape Tool.

        The particular 10-year-old automated VBA process that requires using this approach is complex and very proprietary in nature. After we migrated it from CorelDraw X5 to CorelDraw X7, we discovered a CorelDraw X7-specific text mapping bug/issue that we never experienced with previous versions of CorelDraw. Through extensive testing, debugging, etc., we discovered that moving the node of one character in a heading text inscription via the Shape Tool resolves the bug/issue 100% of the time. No other approach—including "HorizShift", "VertShift", "RangeKerning", and "Move"—resolves it.

        So, ultimately, we need to write VBA code that will specifically select and slightly move the node of one character in a CorelDraw X7 heading text inscription via the Shape Tool.

        Thanks again.
        • Any other suggestions?