WD: WordBasic Macro to Generate Catalog of Clip-Art PicturesLast reviewed: February 2, 1998Article ID: Q86710 |
The information in this article applies to:
SUMMARYThis article contains a macro that you can use in Microsoft Word to display or print a catalog of the graphic images in Word. This macro is helpful because there is no printed documentation showing the graphic images in Word. These images are located in the CLIPART subdirectory. The macro below creates a document, inserts each graphic image in a table (three images per row), and lists the filename of each image. Note: There is a limit of 200 total images built into this macro.
MORE INFORMATION
Sub MAIN ' Dimension an array to hold the filenames of the images. Dim f$(200) ' Insert a three column table to provide a columnar place to ' display the images. TableInsertTable .NumColumns = "3" ' Loop through all the filenames that meet the specified ' image type using the Files$() function from WordBasic. i = 0 file$ = Files$("*.wmf") f$(i) = file$ While file$ <> "" file$ = Files$() i = i + 1 f$(i) = file$ Wend ' Now that the filenames are stored in an array, loop ' through the array and bring in the images. For j = 0 To i - 1 ' First insert the filename and a paragraph mark. Insert f$(j) InsertPara ' Now insert the picture and some paragraph marks. InsertPicture f$(j) CharLeft 1, 1 CharRight InsertPara InsertPara InsertPara ' Use the NextCell command to generate a new row in the table. NextCell Next j End SubNOTE: Word 6.x for the Macintosh users, replace the line:
file$ = Files$("*.wmf")with:
file$ = Files$(MacID("PICT")) Using This MacroTo use this macro, follow these steps:
|
Additional query words: hard copy
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |