Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Printing Graphic Thumbnails.

Printing Graphic Thumbnails

Written by Allen Wyatt (last updated March 1, 2021)
This tip applies to Word 97, 2000, 2002, and 2003


If you work with graphics quite a bit, you are probably already familiar with the term "thumbnails." These are smaller versions of your graphics, printed on a single page, that allow you to get a "birds-eye view" of all your graphics. Many graphics programs and desktop publishing programs include a thumbnail feature that allows you to automatically print your overview. Unfortunately, Word does not include this feature, but you can add such a feature with a macro. The following VBA macro creates a set of thumbnail images from the contents of a single directory:

Sub Thumbnails()
   Dim Directory As String
   Dim FType As String
   Dim FName As String
   Dim ColCount As Integer, J As Integer

   Directory = "d:\temp"
   FType = "*.jpg"

   With Application.FileSearch
      .FileName = FType
      .LookIn = Directory
      .Execute
      If .FoundFiles.Count > 0 Then
         Documents.Add
         ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, _
             NumColumns:=5
         Selection.Tables(1).Select
         Selection.Cells.HeightRule = wdRowHeightAuto
         With Selection.Rows
            .Alignment = wdAlignRowCenter
            .AllowBreakAcrossPages = False
            .SetLeftIndent LeftIndent:=InchesToPoints(0), RulerStyle:= _
                wdAdjustNone
         End With
         Selection.HomeKey Unit:=wdLine
         ColCount = 1
      End If

      For J = 1 To .FoundFiles.Count
         FName = .FoundFiles(J)
         Selection.InlineShapes.AddPicture FileName:=FName, _
            LinkToFile:=False, SaveWithDocument:=True
         Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
         Selection.TypeParagraph
         With Selection.Font
            .Name = "Arial"
            .Size = 10
            .Bold = True
         End With
         Selection.TypeText Text:=Mid$(FName, Len(Directory) + 2)
         Selection.MoveRight Unit:=wdCharacter, Count:=1
         ColCount = ColCount + 1
         If ColCount = 6 Then
            If J <> .FoundFiles.Count Then
               Selection.InsertRows 1
               Selection.EndKey Unit:=wdLine
               Selection.MoveRight Unit:=wdCharacter, Count:=1
               Selection.InsertRows 1
               Selection.HomeKey Unit:=wdLine
               ColCount = 1
            End If
         End If
      Next J
   End With
End Sub

In this macro, all you need to do is change the line specifying the Directory variable to reflect the directory in which your graphics are stored. You can also change the graphic file specification by changing the assignment of FType (currently it is set to return all JPG files in the directory). When you run this macro, a new document is created and the macro starts building a table with five columns and however many rows are necessary to print your graphics. The macro will print about 40 or so thumbnails on a piece of paper, depending on the settings you use in your default template.

There is a caveat to using this macro—you should be aware that your document size will grow very, very fast. While the graphics are shown in a small (thumbnail) size in the document, behind the scenes the graphics are maintained at their full size. If you have lots and lots of graphics being processed, then the document size may become unwieldy and you could end up with very sluggish response times from your system.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (116) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Printing Graphic Thumbnails.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Determining a Column Width

When laying out your document, you may wonder what width you should use for your text. An old typographers trick may help ...

Discover More

Turning Off Proofing for Superscripts

When you add superscripts to words in your document, you may not want those superscripts to be spell-checked. Here's how ...

Discover More

Using Named Ranges in a Macro

Named ranges are a great capability provided by Excel. You can define all sorts of named ranges in a workbook, but how do ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (menu)

Displaying a Message in the Status Bar

A great place for your macro to display status information is, well, in the status bar. Displaying the information is ...

Discover More

Printing the Active Document from a Macro

When you process a document in a macro, you may also want to print that document from within the same macro. Here's how ...

Discover More

Screen Flip Flop with VBA

Word allows users to conveniently work with multiple documents at the same time. When writing macros, you may need to ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is eight more than 4?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.