title: How to prevent link formatting from changes when editing link using VBA?
body: <p>I'm currently using the following code to update all the links in my application:</p>
  
  <pre><code>Sub AddSources()
      Dim pubPage As Page
      Dim pubShape As Shape
      Dim hprlink As Hyperlink
      Dim origAddress() As String
      Dim exportFileName As String
      exportFileName = "TestResume"
      Dim linkSource As String
      linkSource = "TestSource2"
  
      For Each pubPage In ActiveDocument.Pages
          For Each pubShape In pubPage.Shapes
              If pubShape.Type = pbTextFrame Then
                  For Each hprlink In pubShape.TextFrame.TextRange.Hyperlinks
                      If InStr(hprlink.Address, "http://bleaney.ca") &gt; 0 Then
                          origAddress = Split(hprlink.Address, "?source=")
                          hprlink.Address = origAddress(0) + "?source=" + linkSource
                      End If
                  Next hprlink
              End If
          Next pubShape
      Next pubPage
      ThisDocument.ExportAsFixedFormat pbFixedFormatTypePDF, "C:\" + exportFileName + ".pdf"
  End Sub
  </code></pre>
  
  <p>The problem is that when I update the links, they lose their formatting. How can I preserve the formatting of the hyperlink? I tried looking at the <a href="http://msdn.microsoft.com/en-us/library/office/aa210504%28v=office.11%29.aspx" rel="nofollow">Copy and Paste</a> methods, but it seems like what I would really need is <a href="http://msdn.microsoft.com/en-us/library/office/ff862719.aspx" rel="nofollow">Paste Special</a>, which doesnt exist on the Range property on the Hyperlink object.</p>