How to find textboxes and floating graphics?
What's the wildcard search string?
Thanks in advance.
How to find textboxes & Floating Graphics
-
- 2StarLounger
- Posts: 105
- Joined: 19 Apr 2010, 10:25
- Location: Hong Kong
How to find textboxes & Floating Graphics
Regards,
Armstrong
Armstrong
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: How to find textboxes & Floating Graphics
You can't find floating objects using the Find, Replace or Go To dialog. These dialogs work with text and inline objects only. You *can* find text in a text box, though.
It is possible to write VBA code that loops through the Shapes collection of a document and inspects the individual shapes.
(BTW this question has been posted earlier at Find Text Box » Windows Secrets Lounge)
It is possible to write VBA code that loops through the Shapes collection of a document and inspects the individual shapes.
(BTW this question has been posted earlier at Find Text Box » Windows Secrets Lounge)
Best wishes,
Hans
Hans
-
- 2StarLounger
- Posts: 105
- Joined: 19 Apr 2010, 10:25
- Location: Hong Kong
Re: How to find textboxes & Floating Graphics
Hi HansV,
Thanks for your fast reply. How to find and delete the surrounding frame of a textbox?
Armstrong
Thanks for your fast reply. How to find and delete the surrounding frame of a textbox?
Armstrong
Regards,
Armstrong
Armstrong
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: How to find textboxes & Floating Graphics
Right-click the border of the text box.
Select "Format Text Box" from the popup menu.
Activate the "Colors and Lines" tab of the dialog.
Select "No Color" from the Color dropdown in the Line section.
Click OK.
In VBA for a selected text box:
Selection.ShapeRange.Line.Visible = msoFalse
Select "Format Text Box" from the popup menu.
Activate the "Colors and Lines" tab of the dialog.
Select "No Color" from the Color dropdown in the Line section.
Click OK.
In VBA for a selected text box:
Selection.ShapeRange.Line.Visible = msoFalse
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- 2StarLounger
- Posts: 105
- Joined: 19 Apr 2010, 10:25
- Location: Hong Kong
Re: How to find textboxes & Floating Graphics
HansV,
Thanks for your help. Perhaps your solution is the only way to automate the global deletion of textboxes.
At least, you confirm Word's Find can't delete textboxes with wildcard strings such as ^2, ^g, and/or ^d.
Thanks.
Armstrong
Thanks for your help. Perhaps your solution is the only way to automate the global deletion of textboxes.
At least, you confirm Word's Find can't delete textboxes with wildcard strings such as ^2, ^g, and/or ^d.
Thanks.
Armstrong
Regards,
Armstrong
Armstrong
-
- 3StarLounger
- Posts: 397
- Joined: 24 Jan 2010, 19:43
- Location: Salt Lake City, Utah, USA
Re: How to find textboxes & Floating Graphics
See also Hans and Stuarts answers to my Post=28252.
Goshute
I float in liquid gardens
I float in liquid gardens
-
- 2StarLounger
- Posts: 105
- Joined: 19 Apr 2010, 10:25
- Location: Hong Kong
Re: How to find textboxes & Floating Graphics
Goshute,
Yes, we share exactly the original issue, namely frames/textboxes generated by OCR.
As for VBA Word, I'm a newie. I'll study your Post.
Thanks.
Armstrong
Yes, we share exactly the original issue, namely frames/textboxes generated by OCR.
As for VBA Word, I'm a newie. I'll study your Post.
Thanks.
Armstrong
Regards,
Armstrong
Armstrong
-
- 3StarLounger
- Posts: 397
- Joined: 24 Jan 2010, 19:43
- Location: Salt Lake City, Utah, USA
Re: How to find textboxes & Floating Graphics
With a lot of help from my friends, here's the code I'm using at present:
Code: Select all
Sub FrameKiller()
' delete all frames & textboxes, keeping text
Dim intC As Integer
With ActiveDocument
For intC = .Shapes.Count To 1 Step -1
With .Shapes(intC)
If .Type = msoTextBox Then .ConvertToFrame
End With
Next intC
For intC = .Frames.Count To 1 Step -1
.Frames(intC).Delete
Next intC
End With
End Sub
Goshute
I float in liquid gardens
I float in liquid gardens
-
- 2StarLounger
- Posts: 105
- Joined: 19 Apr 2010, 10:25
- Location: Hong Kong