View Full Version : Get the InlineShapes from a Textbox
Adamski
06-08-2009, 06:29 AM
Hello,
I have a textbox created by:
oShape = oHeaderFooter.Shapes.AddTextbox(...)
I can then copy and paste some inline shapes into the textbox, but how can I then get those InlineShape objects with vba.
I tried:
oShape.TextFrame.TextRange.InlineShapes.Count
oShape.TextFrame.ContainingRange.InlineShapes.Count
both return 0 when there are images in the textbox.
Thanks
fumei
06-08-2009, 10:18 AM
How can they be InlineShapes within the textbox Shape?
Adamski
06-08-2009, 10:39 AM
Yeah, I wondered that. That is probably why it dosen't work. They act like characters in the textbox though - not floating.
Anyway, I have change method so I don't need this now. Still, there must be a way I'd have thought.
Cheers,
Adam
fumei
06-08-2009, 12:53 PM
"They act like characters in the textbox though - not floating." Yes, but the textbox floating, yes?
They may "act like" characters, but in a sense...they are not.
Try this.
Take a blank document. Make two textboxes. Fill them up with text..LOTS of text. Say make it so the two textboxes take up two pages (one each), filled with "text".
Now run Word Count.
Result?
Pages 2
Words 0
Characters (no spaces) 0
Characters (with spaces) 0
Paragraphs 0
Lines 2
To Word, even though there could be literally hundreds of words inside the textboxes, there are no words in the document. Textboxes are Shapes and are graphics.
Interesting issue/problem though. I just wasted an hour trying to do what you want to do...and I have not been able to either.
This is why I hate and never use Textboxes. I have disliked them in Word going back to Word 4...
I am going to slug away at it though, just because I dislike not making Word do what I want....
I can duplicate having InlineShapes within a Shape, but damned if I can get them to DO anything.
Adamski
06-09-2009, 10:08 AM
Yep, the textbox is floating.
Please don't waste time tring to solve this on my account - I have stopped trying.
fumei
06-09-2009, 11:45 AM
I am not trying on your account. I am trying for MY account.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.