+ Reply to Thread
Results 1 to 5 of 5

Word macro to get links

  1. #1
    Registered User
    Join Date
    05-06-2013
    Location
    London, England
    MS-Off Ver
    Word 2010
    Posts
    3

    Word macro to get links

    I tend to create rather long MS Word 2010 documents and include both pictures (png) and bits of text (other word documents, txt etc...) and generally use the "Insert and Link" option (so that the objects update automatically in my document as I change them).

    However sometimes I forget where the object is being picked up from, and I still haven't found a quick way to retrieve the full link (which must be stored somewhere given that Word updates it automatically). I've used File/Info/Edit Link to Files but that just gives me a very long and unhelpful list sorted by linked object type. Is there a way to create an exact copy of the document I'm looking at but replace all the linked objects with their directories?

    Let's say I have a document D.docx with lots of linked pictures and text from a variety of directories. Is it possible to build a Word macro that creates a document D_withLinks.docx that preserves the text but replaces all linked content with the original full link (directory and filename)? This way one would be able to open both documents, compare the two and find the link quite easily. Obviously if D_withLinks.docx could have both object and full file path it would be even better.

    Any input would be greatly appreciated!

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word macro to get links

    For the body of the document, you could use code like:
    Please Login or Register  to view this content.
    Note: For objects with 'around' text wrapping, the output goes next to wherever they're anchored. For inline objects, the output appears after them.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    05-06-2013
    Location
    London, England
    MS-Off Ver
    Word 2010
    Posts
    3

    Re: Word macro to get links

    Dear Paul,
    this is great. It picks up all the linked pictures. Do you think there's a way to do the same for text from files? I include lots of text (particularly in footnotes) from .txt and .doc files in my .docx file using: Insert/Text/ Object from file/ Text from file .

    Many thanks

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Word macro to get links

    For those, finding the source is as simple as pressing Alt-F9 to expose the field code.

  5. #5
    Registered User
    Join Date
    05-06-2013
    Location
    London, England
    MS-Off Ver
    Word 2010
    Posts
    3

    Re: Word macro to get links

    Silly me! Thank you very much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1