Macro to expand all hyperlinks in place in a word document

Discussion in 'Word Programming' started by sandeep6699@yahoo.com, Jun 22, 2013.

  1. Guest

    Hello,

    I would appreciate if someone could suggest how I can expand all hyperlinks in a word document AT THE CORRECT PLACE. I know that with Alt+F9 you can switch between the label view and the hyperlink view, but I want to see both at the same time.

    Thanks,
    SS
     
    , Jun 22, 2013
    #1
    1. Advertisements

  2. Guest

    On Saturday, June 22, 2013 11:32:40 AM UTC-7, wrote:
    > Hello,
    >
    >
    >
    > I would appreciate if someone could suggest how I can expand all hyperlinks in a word document AT THE CORRECT PLACE. I know that with Alt+F9 you can switch between the label view and the hyperlink view, but I want to see both at the same time.
    >
    >
    >
    > Thanks,
    >
    > SS


    Thanks to the following website, I was able to come up with the macros that I wanted:
    http://www.msofficeforums.com/word-vba/11940-word-macro-reformats-embedded-links-doc.html


    Sub TagHyperlinks()
    Dim HLnk As Hyperlink
    For Each HLnk In ActiveDocument.Hyperlinks
    HLnk.Range.InsertAfter " (" & HLnk.Address & ") "
    Next
    End Sub


    Sub TagHyperlinks_selected()
    Dim HLnk As Hyperlink
    With Selection.Find
    For Each HLnk In Selection.Hyperlinks
    HLnk.Range.InsertAfter " (" & HLnk.Address & ") "
    Next
    End With
    End Sub



    SS
     
    , Jun 23, 2013
    #2
    1. Advertisements

  3. Stefan Blom Guest

    Thanks for sharing it with us. :)

    --
    Stefan Blom
    Microsoft Word MVP



    sandeep6699 wrote in message
    news:...
    >
    > On Saturday, June 22, 2013 11:32:40 AM UTC-7, wrote:
    > > Hello,
    > >
    > >
    > >
    > > I would appreciate if someone could suggest how I can expand all
    > > hyperlinks in a word document AT THE CORRECT PLACE. I know that with
    > > Alt+F9 you can switch between the label view and the hyperlink view, but
    > > I want to see both at the same time.
    > >
    > >
    > >
    > > Thanks,
    > >
    > > SS

    >
    > Thanks to the following website, I was able to come up with the macros
    > that I wanted:
    > http://www.msofficeforums.com/word-vba/11940-word-macro-reformats-embedded-links-doc.html
    >
    >
    > Sub TagHyperlinks()
    > Dim HLnk As Hyperlink
    > For Each HLnk In ActiveDocument.Hyperlinks
    > HLnk.Range.InsertAfter " (" & HLnk.Address & ") "
    > Next
    > End Sub
    >
    >
    > Sub TagHyperlinks_selected()
    > Dim HLnk As Hyperlink
    > With Selection.Find
    > For Each HLnk In Selection.Hyperlinks
    > HLnk.Range.InsertAfter " (" & HLnk.Address & ") "
    > Next
    > End With
    > End Sub
    >
    >
    >
    > SS
     
    Stefan Blom, Jun 26, 2013
    #3
    1. Advertisements

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Starfishjoe
    Replies:
    1
    Views:
    110
    Jay Freedman
    Nov 18, 2007
  2. newbei
    Replies:
    3
    Views:
    296
    Doug Robbins - Word MVP
    May 29, 2008
  3. Vincent Isoz

    XML Ribbion Gallery Expand

    Vincent Isoz, Feb 8, 2009, in forum: Word Programming
    Replies:
    1
    Views:
    189
    Tony Jollans
    Feb 8, 2009
  4. christophercbrewster via OfficeKB.com

    Making all hyperlinks relative

    christophercbrewster via OfficeKB.com, Nov 23, 2009, in forum: Word Programming
    Replies:
    2
    Views:
    153
    macropod
    Nov 24, 2009
  5. John
    Replies:
    2
    Views:
    192
    Graham Mayor
    Nov 13, 2010
  6. 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,285
    Jay Freedman
    May 11, 2011
  7. Replies:
    0
    Views:
    572
Loading...