Word Macro to Extract Hyperlinks from a document

Discussion in 'Word Programming' started by sandeep6699@yahoo.com, Apr 26, 2013.

  1. Guest

    Hello,

    From the website http://www.tek-tips.com/viewthread.cfm?qid=1689945 I
    got the following macro to extract hyperlinks embedded in a Word
    document:



    Function doHL()
    Dim nd As Document
    Dim a As Document
    Dim h As Hyperlink
    Dim r As Range

    Application.ScreenUpdating = False

    Set a = ActiveDocument
    Set nd = Documents.Add

    For Each h In a.Hyperlinks
    Set r = nd.Range
    r.Collapse
    r.InsertParagraph
    r.InsertAfter (h.Address)
    Next

    nd.Activate
    Application.ScreenUpdating = True
    Application.ScreenRefresh
    End Function






    The macro works like a charm, except that it lists the hyperlinks in
    reverse order. Can someone kindly suggest a tweak to reverse (i.e.
    correct) the order of hyperlinks in the document.

    Thanks,
    SS
     
    , Apr 26, 2013
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr Anderson

    extract text from table

    Mr Anderson, Feb 2, 2007, in forum: Word Programming
    Replies:
    1
    Views:
    128
    Perry
    Feb 3, 2007
  2. miztaken
    Replies:
    0
    Views:
    154
    miztaken
    May 9, 2008
  3. Hafeez Esmail

    Programatically extract selected data (and structure)

    Hafeez Esmail, Jun 5, 2008, in forum: Word Programming
    Replies:
    1
    Views:
    84
    Cindy M.
    Jun 8, 2008
  4. henry
    Replies:
    4
    Views:
    228
    henry
    Jul 19, 2008
  5. Jethro

    Extract Bitmap from inlineshape object

    Jethro, Sep 12, 2008, in forum: Word Programming
    Replies:
    3
    Views:
    286
    Jethro
    Sep 12, 2008
  6. Replies:
    1
    Views:
    157
    Graham Mayor
    Jan 16, 2009
  7. Generic Usenet Account

    Word macro to extract tables from a WORD document

    Generic Usenet Account, May 10, 2011, in forum: Word Programming
    Replies:
    1
    Views:
    1,249
    Jay Freedman
    May 11, 2011
  8. Replies:
    2
    Views:
    426
    Stefan Blom
    Jun 26, 2013
Loading...