View Single Post
 
Old 02-20-2014, 02:15 PM
Esgrimidor Esgrimidor is offline Windows XP Office XP
Advanced Beginner
 
Join Date: Jun 2009
Posts: 35
Esgrimidor is on a distinguished road
Default Add a word 2010 function to template

How can I add this word function (macro) to the template exactly. I try with no results. I get functioning, but not to save to template for not copy/paste everytime I want to execute the function in a document to extract the hiperlinks.....
For word 2010


This is the code :
Code:
    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
Save the function to the normal.dotm or corresponding to have for ever available....

Best Regards
Reply With Quote