Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Feb 2002
    Location
    Fort Collins, Colorado, USA
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Keeping track of linked pictures

    In Word 2003 I usually inserted my pictures using the Link option, or Link-and-Insert options. The primary reason was not to make the file smaller, or even to have a convenient way of updating changes, but rather to insert a record of what the picture filename (and path) was. This worked because the Insert>Picture from file operation actually inserted an INCLUDEPICTURE field that could then be displayed.

    This has been changed in Word 2010, and I don't know how to get the same funtionality (and judging from internet searching many others are troubled too).

    The Insert > Picture operation now inserts some kind of link, not a field code. Allegedly, you can work with this through the Edit links to Files command, which brings up a Links dialogue, which contains a list of all links in the file and some tools for manipulating them. Allegedly (again) if you first select a picture and then issue this command, the link relating to the picture will be highlighted in this list, showing the filename and path.

    It's not working for me. Sometimes the highlighted item will be correct, sometimes not (sometimes it just seems to be the first one in the list, or perhaps the first picture-type link. Have others experienced this, or is my file somehow corrupt?

    In addition, the path seems to be handled differently now. It acts like the stored path is absolute, not relative. Our in-house guru told me that this was intentional by Microsoft, and is related to a security issue.

    Between these two issues, the whole concept of inserting pictures as links is pretty useless to me. It seems I need to develop a whole different way of managing my pictures, and a way to send the document file and the picture files to another person and ensure that he will see the right thing (without recreating my entire dummy folder tree in a document I send to him).

    Can anybody 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
    You could create your own InsertPicture function that uses the old INCLUDEPICTURE field.

    This old thread has some examples of how to replace or "hijack" the Insert Picture dialog: Insert Picture.

    Being ten years old, that code might not work in Word 2010 as written, but you see the idea: use a dialog to capture the path to the picture, then use VBA code to actually insert the picture/field.

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    This is how I handled the same problem you are having. This code is probably more complicated than you need but I have left it all in there in case you wanted to do some of those extra things too.
    Code:
    Sub InsertLinkedGraphic()
      Dim sPath As String, sFile As String, sFldText As String
      Dim sDefault As String
      '''store the default path
      sDefault = Options.DefaultFilePath(wdPicturesPath)
      sPath = ActiveDocument.Path
      '''change the default path temporarily
      Options.DefaultFilePath(wdPicturesPath) = sPath & "\GraphicsPrint\"
      With Dialogs(wdDialogInsertPicture)
        If .Display = -1 Then                        ' Display dialog only, don't insert.
          ' Proceed if dialog not Canceled.
          sFile = .Name
          If InStr(sFile, sPath) > 0 Then      'make path relative if possible
            sFile = Replace(sFile, sPath, ".")
            sFile = Replace(sFile, "\", "/")
          End If
          sFldText = "IncludePicture " & Chr(34) & sFile & Chr(34) & " \d"
          ActiveDocument.Fields.Add Range:=Selection.Range, Text:=sFldText, Type:=wdFieldEmpty, PreserveFormatting:=False
        End If
      End With
      '''restore to the default picture path
      Options.DefaultFilePath(wdPicturesPath) = sDefault
    End Sub
    There are problems with the 'relative path' sticking as you have already found out so I use code to resolve that too but a simple alternative is to reveal the field codes and use search and replace to change the path.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    Star Lounger
    Join Date
    Feb 2002
    Location
    Fort Collins, Colorado, USA
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks to both of you for the suggestions.

    I knew that there was probably a solution along these lines, if I wanted to resort to VBA, and if I do this certainly jump-starts me.

    But actually, I was hoping to either confirm that my observations re the newly-screwed-up edit links feature are not just me, and to hope that maybe someone (Microsoft?) could offer a built-in "standard" technique that doesn't involve programming. (I have learned the hard way to try if possible to avoid customizing when the results have to function on various people's computers.) After all, Microsoft must think that the old method I described is not to be recommended any more, and surely they have a new and improved technique for keeping track of linked pictures. I suspect that the new edit links feature is SUPPOSED to do that, but it seems nobody has documented the intended technique--or even how the feature is supposed to work--and it is too inconsistent to reverse-engineer.

    Are there lots of people out there like me who worked long and hard to develop a technique for this, standardized it and got it adopted within a local work group, and now find it not functioning and obsolete without a suggested replacement?

Posting Permissions

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