Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Hello,
    I am using MS Word 2003 at work. I have a good sized document (132 pages) that contains over 200 drawings (.EMF) that are "linked to file". This system works great in that I can update a drawing and the latest change will automatically be seen in the document. Also, I have a Macro (thanks to WOPR) that allows me to generate a "List of IncludePicture Paths". The only problem I am facing is that if I insert a new figure and figure title anywhere in the document and then do: "CTRL A and F9" then all the graphics are erased and I am left with empty boxes. It is too cumbersome to find each figure, figure title and cross-reference and individually highlight and hit F9. So, is there a way to fix this problem, short of going back into the document and embedding 200 plus graphics again? Any assistance provided on this problem is very much appreciated. Regards, Jim

  2. #2
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Hello Hans,

    Thanks for the quick response. I appreciate it.

    I tried your Macro and got the following error: "Compile Error Loop Without Do". I am not a Macro GURU, but I would say that I need additional code here. Do you have any additional code that would make the macro complete and execute without errors? All of my graphics are linked to file and I am using EMFs for graphics. What should happen if I run this macro against my document where there are empty boxes instead of figures? Will it fix these graphics or is this macro just a preventative measure to be undertaken before issuing a CTRL A and F9 command (to update a document that has new figures, tables, figure titles, table titles and cross references)? Thanks again. Jim

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Error corrected by HansV

    Perhaps updating 200 pictures at once is too heavy a drain on resources. Does the following macro work better? It updates fields one by one.

    Sub UpdateFields()
    Dim f As Field
    For Each f In ActiveDocument.Fields
    f.Update
    DoEvents
    Next f
    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Sorry, it was air code. The line

    Loop

    should have been

    Next f

    The macro is intended to be run instead of pressing Ctrl+A followed by F9.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Hello Hans,

    Okay, I will give your macro a try.

    Will this macro (when run) bring back graphics that were linked to file and are now only showing up in the document as empty boxes?

    BTW - Our documents exist on a shared corporate network drive and a typical figure and figure title in a document might look like this:

    FIGURE

    {INCLUDEPICTURE "EMFs/Router Folder/Router Front View.emf" * MERGEFORMAT d }

    FIGURE TITLE

    Figure { AUTONUMLGL * Arabic e }. Router Front View

    Once again, any assistance you can provide is appreciated.

    Thanks,

    Jim

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    I don't know if the macro will restore empty boxes. It doesn't hurt to try, but I'd make a backup copy of the document before doing so, just to be on the safe side.

  7. #7
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Hans (or anyone) -

    One more question. Is it possible to run a Macro to generate a list of graphics in a Word document, when all the graphics are embedded? What if all the graphics had the same file extension (e.g. .emf)? Thanks, -J

  8. #8
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Hello Hans,
    Yes I already made a backup and have tried to restore the empty boxes back to their original linked graphic, but no success. Right now, until I can find a better way, I am manually embedding all 200 graphics again. This is such a pain that MS Word would do such a thing. I already have the empty boxes, so it would appear to be too late for the current document I am updating, but your Macro will hopefully prevent this from happening again in the future.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    You can create a list of all pictures in a document using a macro, but if the pictures are embedded (not linked), all information about the original file names is lost, this is not stored in an embedded picture (as far as I know).

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    I don't really know what causes this. Earlier this week I produced a report in Word using mailmerge containing about 1,500 linked .jpg pictures and 1,500 linked .html tables, almost 6,000 pages in all. After the mailmerge finished, not all pictures and tables had been updated correctly, so I did exactly what you described - press Ctrl+A then F9, and although it took more than 5 minutes, everything was updated correctly in the end.

  11. #11
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Hello Hans,

    Well I see the problem happen when I add a brand NEW FIGURE (graphic linked to file) and FIGURE NUMBER in the middle of an existing document and then run: CTRL A and F9. That's when all the graphics disapear, leaving me with empty boxes. Of course the Figure Numbers are now updated, but the graphics are gone. The ALT F9 command will show me the field codes for the Figures and Figure Numbers, but it does not matter as the graphics are gone. There must be some way to restore all these figures (linked to file) back into the Word document; aside from manually linking each one to file again or embedding them. Any additional thoughts? -J

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Are you sure that the path to the linked graphics is still valid?

  13. #13
    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: Word 2003 - Linking Graphics to File (MS Word

    > Is it possible to run a Macro to generate a list of graphics in a Word document, when all the graphics are embedded?

    I think we looked into this a few years ago. If you open the file using "Recover Text from Any File (*.*)" as the format in the File Open dialog (remember to change it back for the next file you open), then you may see some or all of the paths of embedded pictures. However, this is not accessible via VBA and, as Word gets better at removing metadata to protect privacy, the information may be removed at any time.

  14. #14
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word 2003, SP2)

    Hello Hans,
    Your a genius! It's the little things missed that are the most important. Okay, question for you now. If I highlight a figure (or CTRL A) and then do ALT F9, I can see the INCLUDEPICTURE path. I had created a new folder on a network drive and a new graphics folder, but the path was different by a small degree. So problem solved, except that now I want to update all the INCLUDEPICTURE paths to the new path. For example:

    Old Path

    { INCLUDEPICTURE "JPGs/XYZ.jpg"
    *MERGEFORMAT d}



    New path:


    { INCLUDEPICTURE "Graphics/JPGs/XYZ.jpg"
    *MERGEFORMAT d}

    Can a Macro be created that will open up a word document and replace all the old field path with the new field path? Or do I have to use Find and Replace in MS Word (provided it will work)?
    Also, I have several documents that need updating. Can I use a Macro to point to a folder location and then run the Macro globally or do I have to open each document one by one and deploy the Macro? I will probably run the Macro one by one, but it is good to know if there are two possible options. Thanks again Hans! You saved the day. -J

  15. #15
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Word 2003 - Linking Graphics to File (MS Word

    Hi Hans,

    I think I found the perfect solution. If I create a new word document and insert graphics using: Insert Picture>Picture>From File>Insert and Link (versus Insert aka embed or Link to File), then I get the best of both worlds. The graphic is now and embedded and I have a link that will automatically update itself if I move the document from one network drive to another. My question to you now is this: Is there a way I can create a Macro that will automatically find any embedded graphic and replace it with the same graphic but using the Insert and Link feature? This way, I can always keep a record of my graphics and the graphic will also be embedded, which is good when I want to email the document to a customer. Any thoughts on this?

    Thanks again for your time.

    Regards,

    Jim

Page 1 of 2 12 LastLast

Posting Permissions

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