Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Graphics / December 2006

Tip: Looking for answers? Try searching our database.

Macro to search for graphics

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Johann Swart - 18 Dec 2006 05:59 GMT
Some time ago someone provided me with a macro to search for graphics that
were created by using any of the tools on Word's Drawing toolbar, i.e. lines,
text boxes, etc.
Unfortunately, when I was given a new PC, my macros and customisation were
not carried over.
Is there anyone out there that has such a macro and is willing to share it?
Lene Fredborg - 20 Dec 2006 22:43 GMT
You do not explain exactly what you expect the macro to do.

Graphics can be in the _text_ layer (wrapping style “In line with text”) or
in the _drawing_ layer (any other wrapping style) of a document.

You can search for graphics in the text layer via the normal Find function
(type ^g in the search field or click the More button and select Special >
Graphic).

It’s my guess that you want a macro that can find graphics in the drawing
layer. If this is the case, I think that the macro found via the link below
is what you are looking for:
http://wordtips.vitalnews.com/Pages/T1447_Searching_for_Floating_Graphics.html

Signature

Regards
Lene Fredborg
DocTools – Denmark
www.thedoctools.com
Document automation – add-ins, macros and templates for Microsoft Word

> Some time ago someone provided me with a macro to search for graphics that
> were created by using any of the tools on Word's Drawing toolbar, i.e. lines,
> text boxes, etc.
> Unfortunately, when I was given a new PC, my macros and customisation were
> not carried over.
> Is there anyone out there that has such a macro and is willing to share it?
Johann Swart - 21 Dec 2006 06:19 GMT
Hi Lene,
Thanks for the response.
I was in fact looking for the second option, i.e. graphics in the drawings
layer, and the hyperlink you provided is the Real McCoy. I have installed it
and it works splendidly.
I work with documents where other compilers sometimes insert text boxes
without background or border colours, in other words, they become invisible
if they also do not contain any text. This macro is mainly used for searching
such text boxes.
Thanks a million!

> You do not explain exactly what you expect the macro to do.
>
[quoted text clipped - 16 lines]
> > not carried over.
> > Is there anyone out there that has such a macro and is willing to share it?
CyberTaz - 22 Dec 2006 23:50 GMT
I'm glad the macro is just what the Dr. ordered, but just one other little
tip - If you turn on the non-printing characters (¶) you'll see the markers
in the otherwise-empty text boxes. Depending on the text wrap applied they
either mark & account for inappropriate white space or appear in places
where they normally 'shouldn't'... That makes such things easier to spot.

HTH |:>)
Bob Jones
[MVP] Office:Mac

On 12/21/06 1:19 AM, in article
A076402A-C61A-4751-86C1-9F00BB2084D8@microsoft.com, "Johann Swart"
<JohannSwart@discussions.microsoft.com> wrote:

> Hi Lene,
> Thanks for the response.
[quoted text clipped - 19 lines]
>> layer. If this is the case, I think that the macro found via the link below
>> is what you are looking for:

http://wordtips.vitalnews.com/Pages/T1447_Searching_for_Floating_Graphics.htm>>
l

>>> Some time ago someone provided me with a macro to search for graphics that
>>> were created by using any of the tools on Word's Drawing toolbar, i.e.
[quoted text clipped - 3 lines]
>>> not carried over.
>>> Is there anyone out there that has such a macro and is willing to share it?
Johann Swart - 27 Dec 2006 06:03 GMT
Hi Bob,
Yes, you're hundred percent correct; it's just so much easier--and
quicker--having to wade through hundreds of pages looking for an empty 10x5
millimetre (½"x¼") text box (with a 6pt paragraph marker) that could or could
not be there.
Thanks for your response Bob; it's highly appreciated!
Regards
Johann Swart

> I'm glad the macro is just what the Dr. ordered, but just one other little
> tip - If you turn on the non-printing characters (¶) you'll see the markers
[quoted text clipped - 44 lines]
> >>> not carried over.
> >>> Is there anyone out there that has such a macro and is willing to share it?
Lene Fredborg - 27 Dec 2006 10:32 GMT
As far as I understand now, you are actually only interested in finding
_empty textboxes_ and delete them. This can be done much easier. The macro
below finds all shapes in the drawing layer of the active document. If a
shape is a textbox and if that textbox contains nothing but a paragraph mark,
the textbox is automatically deleted. When finished, a message tells you how
many textboxes have been deleted.

Sub DeleteEmptyTextBoxes()

   Dim oShape As Shape
   Dim nCount As Long
   
   nCount = 0
   For Each oShape In ActiveDocument.Shapes
       If oShape.Type = msoTextBox Then
           'If textbox contains only a paragraph mark, delete it
           If Len(oShape.TextFrame.TextRange) = 1 Then
               oShape.Delete
               nCount = nCount + 1
           End If
       End If
   Next oShape
       
   MsgBox nCount & " empty textbox(es) deleted."
       
End Sub

Signature

Regards
Lene Fredborg
DocTools – Denmark
www.thedoctools.com
Document automation – add-ins, macros and templates for Microsoft Word

> Hi Bob,
> Yes, you're hundred percent correct; it's just so much easier--and
[quoted text clipped - 53 lines]
> > >>> not carried over.
> > >>> Is there anyone out there that has such a macro and is willing to share it?
Suzanne S. Barnhill - 27 Dec 2006 13:37 GMT
Displaying text boundaries makes text boxes easier to see as well.

Signature

Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> Hi Bob,
> Yes, you're hundred percent correct; it's just so much easier--and
[quoted text clipped - 42 lines]
> > >> layer. If this is the case, I think that the macro found via the link below
> > >> is what you are looking for:

http://wordtips.vitalnews.com/Pages/T1447_Searching_for_Floating_Graphics.htm>>
> > l
> > >>
[quoted text clipped - 5 lines]
> > >>> not carried over.
> > >>> Is there anyone out there that has such a macro and is willing to share it?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.