1 Reply Latest reply on Oct 31, 2010 6:50 PM by Boble5

    [VB CS5] Add text to rectangle

    Boble5

      This does not work

       

      Set oImageRect = myDocument.Pages.Item(1).Rectangles.add
      oImageRect.GeometricBounds = Array(50,0,25,25)
      oImageRect.content="hi there"

       

      Because a rectangle is not a text frame.

       

      How to add text to it? I have read you need to convert the rectangles content type to text but i can't find the syntax.

      These don't work

       

      oImageRect.contentType=TEXT_TYPE

      oImageRect.contentType=ContentType.TEXT_TYPE

        • 1. Re: [VB CS5] Add text to rectangle
          Boble5 Level 1

          After digging around here i found a way to list the id number of the text content type.

           

          It is 192412773

           

          So this works and allows you to add text to a rectangle.

           

          Set oImageRect = myDocument.Pages.Item(1).Rectangles.add
          Set TextFrameg = myDocument.Pages.Item(1).TextFrames.add

           

          oImageRect.GeometricBounds = Array(50,0,25,25)

           

          rem this message box displays the content type of a text frame which is 1952412773
          msgbox(TextFrameg.ContentType)

          rem sets the rectangle to that id
          oImageRect.ContentType= 1952412773

          oImageRect.contents="now i can add text"