Results 1 to 4 of 4
  1. #1
    jackinthebox
    Guest

    Image source in Word documents

    I need to get the filenames/paths of all the images in a word document, and i can't seem to find any way of doing that in VB/VBA. Does anyone know how to do this, or even if it's possible at all?

  2. #2
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Oregon, USA
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Image source in Word documents

    Hi jackinthebox,

    I'm assuming the pictures are INCLUDEPICTURE fields? How's this for a start...

    Dim fldField As Field
    Dim strString As String


    For Each fldField In ActiveDocument.Fields
    If fldField.Type = wdFieldIncludePicture Then
    strString = strString & fldField.Code & vbCr
    End If
    Next

    MsgBox strString


    HTH,

    Chris

  3. #3
    jackinthebox
    Guest

    Re: Image source in Word documents

    Thanks that helps.
    I was just wondering, is there any way to get the source file if the image was inserted as a Linked Object?

  4. #4
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Oregon, USA
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Image source in Word documents

    Sure. Change the "wdFieldIncludePicture" syntax to read "wdFieldLink."

Posting Permissions

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