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?

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. Bill Gates

    Put string in any place to word document by vb6

    Bill Gates, Jul 5, 2007, in forum: Word Programming
    Replies:
    0
    Views:
    79
    Bill Gates
    Jul 5, 2007
  2. Starfishjoe
    Replies:
    1
    Views:
    80
    Jay Freedman
    Nov 18, 2007
  3. newbei
    Replies:
    3
    Views:
    274
    Doug Robbins - Word MVP
    May 29, 2008
  4. Vincent Isoz

    XML Ribbion Gallery Expand

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

    Making all hyperlinks relative

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