PDA

Click to See Complete Forum and Search --> : Count textlines in textbox shape


lvermeersch
Dec 10th, 2005, 06:49 AM
My project is allmost finished, still need to solve a few codeproblems.
I use Word automation in my VB6 application.
Set Appword = CreateObject("Word.Application")
How can i get the handle of the active textboxshape ?

Note this is not a textbox but a textbox shape
so
Set Tbox = AppWord.Selection.Shaperange

Then you can access the textbox shape
tk = Tbox.TextFrame.Textrange.text 'gets it's text
But how to get it's handle?
I need this to count the number of lines visible in the textbox shaperange.
(The lince count is NOT , the lines seperated bij a vbcr, is not the number of sentences seperated bij a point..) I need the number of wordwraped lines, you can see in the textbox.

I know of a way using SendMessage but i need the active Textbox shape's handle for this. Or other ideas are welcome.