Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    Anaheim, California, USA
    Posts
    560
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Pictures with Captions (Word 97/SR2)

    I have a lot of digital photos that I want to insert into a Word Document. Is there a way to get the filename of the photo to print as a caption or as plain text just below the picture. This would save a lot of time. Thanks for any help.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Pictures with Captions (Word 97/SR2)

    There was a recent discussion on this board about using a VBA program to import pictures and apply certain characteristics to them, such as borders. If you were to use this kind of approach, the VBA code could grab the file name and type that in for you. In fact, this might be all you need:

    <pre>Sub InsertPicturesOnSteroids()
    Dim strFileName As String
    Do
    With Dialogs(wdDialogInsertPicture)
    If .Display = 0 Then Exit Do
    strFileName = .Name
    .Execute
    With Selection
    .Collapse wdCollapseEnd
    .TypeParagraph
    .TypeText strFileName
    .TypeParagraph
    .TypeParagraph
    End With
    End With
    Loop
    End Sub</pre>

    You could customize this to format differently. You also could get rid of the path, but you know, a little find and replace after the fact probably would be a heck of a lot faster. Hope this helps.

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Pictures with Captions (Word 97/SR2)

    Jefferson

    What was the purpose of the Do Loop in this bit of code?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    Anaheim, California, USA
    Posts
    560
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Re: Pictures with Captions (Word 97/SR2)

    That worked perfectly. Thank you for your help.

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Pictures with Captions (Word 97/SR2)

    This dialog does not let you select multiple files, so I bring it back up so you can insert multiple files. Ahem. It was a whole lot easier than pulling all the file names into a listbox. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> However, I regret that I couldn't find a way to position the selection bar in the list in the dialog on the last file opened (even though I have the name). That would have been nice. (And lets not even talk about using SendKeys to do it!)

  6. #6
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    Anaheim, California, USA
    Posts
    560
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Re: Pictures with Captions (Word 97/SR2)

    Being able to select multiple files would definately be cool, since, in this instance, I have about 100 pictures that I am placing in the Word document. In the meantime, this sure works better than having to insert each one, then type the name. Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •