Results 1 to 1 of 1

Thread: Count exact textlines in textbox shape

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    91

    Count exact textlines in textbox shape

    I'm using word Automation through my vb6.
    I use the textbox shapes and want to check the number of textlines existing in the active textbox shape.

    I know how to to this when wordwrap is off (by counting vbCR)
    , but is'nt correct when wordwrap is ON. How to solve this

    I can get the active text from the textboxShape:


    VB Code:
    1. Set TBox = AppWord.Selection.ShapeRange
    2. tk = Tbox.TextFrame.TextRange.Text


    Maybe there is a count prop or something. Any idea's?

    Extra info: maybe i need to check on the linebreaks chr(10) but did this with a instr() function and it doens't find any.
    tk = AppWord.Selection.Shaperange.TextFrame.TextRange.Text
    Firstlinebr = instr(tk,chr(10))
    Last edited by lvermeersch; Nov 16th, 2005 at 04:59 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width